mirror of
https://gitea.0xace.cc/ansible-galaxy/monit.git
synced 2025-07-03 18:03:07 +00:00
add monit templates
This commit is contained in:
@ -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:
|
||||
|
Reference in New Issue
Block a user