diff --git a/tasks/main.yml b/tasks/main.yml index 77c7a22..d3012df 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,14 +1,17 @@ --- -- include: debian/pkg.yml +- include_tasks: debian/pkg.yml tags: monit_pkg when: ansible_os_family == "Debian" -- include: redhat/pkg.yml +- include_tasks: redhat/pkg.yml tags: monit_pkg when: ansible_os_family == "RedHat" -- include: config.yml +- include_tasks: config.yml tags: monit_config -- include: monitors.yml +- include_tasks: monitors.yml tags: monit_monitors + +- include_tasks: service.yml + tags: monit_service diff --git a/tasks/service.yml b/tasks/service.yml new file mode 100644 index 0000000..7e4a27a --- /dev/null +++ b/tasks/service.yml @@ -0,0 +1,7 @@ +--- +- name: service - ensure running and enabled + service: + name: "{{ monit_service }}" + state: started + enabled: yes + diff --git a/vars/debian.yml b/vars/debian.yml index d02a2c3..b9a97e6 100644 --- a/vars/debian.yml +++ b/vars/debian.yml @@ -1,3 +1,4 @@ --- +monit_service: monit monitrc_conf: /etc/monit/monitrc -monit_includes: /etc/monit/conf.d \ No newline at end of file +monit_includes: /etc/monit/conf.d diff --git a/vars/redhat.yml b/vars/redhat.yml index d876cfd..89e5615 100644 --- a/vars/redhat.yml +++ b/vars/redhat.yml @@ -1,3 +1,4 @@ --- +monit_service: monit monitrc_conf: /etc/monitrc monit_includes: /etc/monit.d