ansible-role-apache/tasks/monitoring.yml
2023-02-08 11:14:15 +01:00

46 lines
1.3 KiB
YAML

---
- name: "Monitoring | Enable Modules"
community.general.apache2_module:
name: status
state: present
notify: reload apache2
- name: "Monitoring | Copy configuration"
ansible.builtin.copy:
src: server-status.conf
dest: /etc/apache2/sites-available/server-status.conf
mode: 0644
- name: "Monitoring | Enable localhost site configuration"
ansible.builtin.command:
cmd: a2ensite server-status
creates: /etc/apache2/sites-enabled/server-status.conf
notify: reload apache2
- name: "Monitoring | Copy munin configuration"
ansible.builtin.template:
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"
ansible.builtin.file:
src: "/usr/share/munin/plugins/{{ item }}"
dest: "/etc/munin/plugins/{{ item }}"
state: link
loop:
- apache_accesses
- apache_processes
- apache_volume
when: "'munin' in ansible_facts.packages"
notify: restart munin-node
- name: "Monitoring | Enable Monit configuration"
ansible.builtin.template:
src: monit.conf
dest: /etc/monit/conf-enabled/apache2
mode: 0644
when: "'monit' in ansible_facts.packages"
notify: reload monit