Run tasks only when packages are installed
This commit is contained in:
parent
ef238e83df
commit
9a97b43cbf
2 changed files with 7 additions and 0 deletions
|
@ -22,6 +22,7 @@
|
|||
src: munin_configuration
|
||||
dest: /etc/munin/plugin-conf.d/yyy-apache
|
||||
mode: 0644
|
||||
when: munin in ansible_facts.packages
|
||||
notify: restart munin-node
|
||||
|
||||
- name: "Monitoring | Enable Munin plugins"
|
||||
|
@ -33,6 +34,7 @@
|
|||
- apache_accesses
|
||||
- apache_processes
|
||||
- apache_volume
|
||||
when: munin in ansible_facts.packages
|
||||
notify: restart munin-node
|
||||
|
||||
- name: "Monitoring | Enable Monit configuration"
|
||||
|
@ -40,4 +42,5 @@
|
|||
src: monit.conf
|
||||
dest: /etc/monit/conf-enabled/apache2
|
||||
mode: 0644
|
||||
when: monit in ansible_facts.packages
|
||||
notify: reload monit
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
---
|
||||
- name: "Packages | Get installed packages"
|
||||
ansible.builtin.package_facts:
|
||||
manager: apt
|
||||
|
||||
- name: "Packages | Install packages"
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
|
|
Loading…
Reference in a new issue