ansible-role-apache/tasks/monitoring.yml

47 lines
1.3 KiB
YAML
Raw Normal View History

2022-06-05 14:59:06 +02:00
---
2023-02-06 22:26:37 +01:00
- name: "Monitoring | Enable Modules"
community.general.apache2_module:
2022-06-05 14:59:06 +02:00
name: status
state: present
notify: reload apache2
2023-02-06 22:26:37 +01:00
- name: "Monitoring | Copy configuration"
2022-12-28 16:07:16 +01:00
ansible.builtin.copy:
2022-06-05 14:59:06 +02:00
src: server-status.conf
dest: /etc/apache2/sites-available/server-status.conf
2022-12-28 16:07:16 +01:00
mode: 0644
2022-06-05 14:59:06 +02:00
2023-02-06 22:26:37 +01:00
- name: "Monitoring | Enable localhost site configuration"
2022-12-28 16:07:16 +01:00
ansible.builtin.command:
cmd: a2ensite server-status
creates: /etc/apache2/sites-enabled/server-status.conf
2022-06-05 14:59:06 +02:00
notify: reload apache2
2023-02-06 22:26:37 +01:00
- name: "Monitoring | Copy munin configuration"
2022-12-28 16:07:16 +01:00
ansible.builtin.template:
2023-02-06 22:26:37 +01:00
src: munin_configuration
2022-06-05 14:59:06 +02:00
dest: /etc/munin/plugin-conf.d/yyy-apache
2022-12-28 16:07:16 +01:00
mode: 0644
2023-02-08 11:14:15 +01:00
when: "'munin' in ansible_facts.packages"
2022-06-28 20:37:26 +02:00
notify: restart munin-node
2022-06-05 14:59:06 +02:00
2023-02-06 22:38:19 +01:00
- name: "Monitoring | Enable Munin plugins"
2022-12-28 16:07:16 +01:00
ansible.builtin.file:
2022-06-05 14:59:06 +02:00
src: "/usr/share/munin/plugins/{{ item }}"
dest: "/etc/munin/plugins/{{ item }}"
state: link
loop:
- apache_accesses
- apache_processes
- apache_volume
2023-02-08 11:14:15 +01:00
when: "'munin' in ansible_facts.packages"
2022-06-05 14:59:06 +02:00
notify: restart munin-node
2023-02-06 22:38:19 +01:00
- name: "Monitoring | Enable Monit configuration"
ansible.builtin.template:
src: monit.conf
dest: /etc/monit/conf-enabled/apache2
mode: 0644
2023-02-08 11:14:15 +01:00
when: "'monit' in ansible_facts.packages"
2023-02-06 22:38:19 +01:00
notify: reload monit