Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Check if snmpd is enabled for upgrade_tasks
Browse files Browse the repository at this point in the history
This check should prevent some error when the upgrade
tasks checks if the snmpd is stopped in step 1

Depends-On: https://review.opendev.org/#/c/695234/
Depends-On: https://review.opendev.org/#/c/695419/
Depends-On: https://review.opendev.org/#/c/695562/
Depends-On: https://review.opendev.org/#/c/696855/
Depends-On: https://review.opendev.org/#/c/695929/
Depends-On: https://review.opendev.org/#/c/696673/

Closes-Bug: #1853812

(cherry picked from commit 709a6b7)

Change-Id: I5cdc9ef6a20b7d18aaa802927959b81a08334753
  • Loading branch information
matbu authored and ccamacho committed Dec 4, 2019
1 parent ae681b4 commit a364005
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion deployment/snmp/snmp-baremetal-puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ outputs:
step_config: |
include ::tripleo::profile::base::snmp
upgrade_tasks:
- when: step|int == 0
block:
- name: Check if snmpd is enabled
command: systemctl is-enabled --quiet snmpd
ignore_errors: True
register: snmpd_enabled_result
- name: Set fact snmpd_enabled
set_fact:
snmpd_enabled: "{{ snmpd_enabled_result.rc == 0 }}"
- name: Stop snmp service
when: step|int == 1
when:
- step|int == 1
- snmpd_enabled|bool
service: name=snmpd state=stopped

0 comments on commit a364005

Please sign in to comment.