mirror of
https://gitea.0xace.cc/ansible-galaxy/monit.git
synced 2025-07-03 09:53:07 +00:00
add monit service role
This commit is contained in:
29
tasks/main.yaml
Normal file
29
tasks/main.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Install EPEL repository
|
||||
yum:
|
||||
package: epel-release
|
||||
state: latest
|
||||
|
||||
- name: Ensure monit {{ monit_version }} installed
|
||||
yum:
|
||||
package:
|
||||
name: monit-{{ monit_version }}
|
||||
state: present
|
||||
register: monit_setup
|
||||
|
||||
- name: Propagate 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)
|
||||
|
||||
- name: Ensure monit enabled and started
|
||||
systemd:
|
||||
name: monit
|
||||
state: started
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
Reference in New Issue
Block a user