Added yum and dnf condition when check_mk_agent

This commit is contained in:
Mann Badal
2023-10-03 09:52:27 +13:00
parent 1c29992d07
commit 8035c87efe

View File

@@ -19,8 +19,26 @@
package_facts:
manager: "auto"
tags: cmk_register
- name: Check if dnf package manager is installed
command: which dnf
register: dnf_check
ignore_errors: yes
- name: Ensure check_mk_agent installed (again)
- name: Ensure check_mk_agent installed (again) with dnf
package:
name: /tmp/check-mk-agent.rpm
state: latest
disable_gpg_check: true
notify:
- restart xinetd
- ensure firewall open
when:
- "'check-mk-agent' not in ansible_facts.packages"
- dnf_check.rc == 0
tags: cmk_register
- name: Ensure check_mk_agent installed (again) with yum
package:
name: /tmp/check-mk-agent.rpm
state: latest
@@ -28,7 +46,9 @@
notify:
- restart xinetd
- ensure firewall open
when: "'check-mk-agent' not in ansible_facts.packages"
when:
- "'check-mk-agent' not in ansible_facts.packages"
- dnf_check.rc != 0
tags: cmk_register
- name: Gather facts of packages (again)