Skip to content
This repository was archived by the owner on Apr 15, 2023. It is now read-only.

Commit 5a3be72

Browse files
committed
make enabling monitoring idempotent
1 parent 549c5ad commit 5a3be72

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tasks/monitoring.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,18 @@
1111
name: "{{ uyuni_monitoring_formulas_packages }}"
1212
when: uyuni_install_monitoring_formulas
1313

14+
- name: Get monitoring status
15+
become: true
16+
command: mgr-monitoring-ctl status
17+
register: monitoring_state
18+
changed_when: false
19+
1420
- name: Enable monitoring
21+
become: true
1522
command: mgr-monitoring-ctl enable
16-
args:
17-
creates:
23+
# args:
24+
# creates: /usr/lib/systemd/system/tomcat.service.d/jmx.conf
25+
when: "'error' in monitoring_state.stdout|lower"
1826
notify: Restart Uyuni
1927

2028
# TODO: enable monitoring in UI?

0 commit comments

Comments
 (0)