You've already forked role-check-mk-agent
Added yum and dnf condition when check_mk_agent
This commit is contained in:
@@ -19,8 +19,26 @@
|
|||||||
package_facts:
|
package_facts:
|
||||||
manager: "auto"
|
manager: "auto"
|
||||||
tags: cmk_register
|
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:
|
package:
|
||||||
name: /tmp/check-mk-agent.rpm
|
name: /tmp/check-mk-agent.rpm
|
||||||
state: latest
|
state: latest
|
||||||
@@ -28,7 +46,9 @@
|
|||||||
notify:
|
notify:
|
||||||
- restart xinetd
|
- restart xinetd
|
||||||
- ensure firewall open
|
- 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
|
tags: cmk_register
|
||||||
|
|
||||||
- name: Gather facts of packages (again)
|
- name: Gather facts of packages (again)
|
||||||
|
|||||||
Reference in New Issue
Block a user