add monit templates

This commit is contained in:
ace
2022-01-28 12:34:11 +03:00
parent 429d56bebe
commit c2887ee25e
3 changed files with 321 additions and 9 deletions

View File

@ -10,15 +10,20 @@
state: present
register: monit_setup
- name: Propagate configs
- name: add monitrc configs
template:
src: monitrc.j2
dest: "/etc/monitrc"
notify:
- Reload monit
- name: add monit.d configs
copy:
content: "{{ item.config }}"
dest: "/etc/monit.d/{{ item.conf_name }}"
notify: Reload monit
with_items:
- "{{ monit_configs }}"
when:
- (monit_configs is defined or monit_configs | length != 0)
content: "{{ item.data }}"
dest: "/etc/monit.d/{{ item.name }}"
loop: "{{ monit.configs|flatten }}"
notify:
- Reload monit
- name: Ensure monit enabled and started
systemd: