diff options
Diffstat (limited to 'lamp_haproxy/aws/roles/nagios/tasks/main.yml')
-rw-r--r-- | lamp_haproxy/aws/roles/nagios/tasks/main.yml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/lamp_haproxy/aws/roles/nagios/tasks/main.yml b/lamp_haproxy/aws/roles/nagios/tasks/main.yml new file mode 100644 index 0000000..69e2d43 --- /dev/null +++ b/lamp_haproxy/aws/roles/nagios/tasks/main.yml @@ -0,0 +1,41 @@ +--- +# This will install nagios + +- name: install nagios + yum: pkg={{ item }} state=present + with_items: + - nagios + - nagios-plugins + - nagios-plugins-nrpe + - nagios-plugins-ping + - nagios-plugins-ssh + - nagios-plugins-http + - nagios-plugins-mysql + - nagios-devel + notify: restart httpd + +- name: create nagios config dir + file: path=/etc/nagios/ansible-managed state=directory + +- name: configure nagios + copy: src=nagios.cfg dest=/etc/nagios/nagios.cfg + notify: restart nagios + +- name: configure localhost monitoring + copy: src=localhost.cfg dest=/etc/nagios/objects/localhost.cfg + notify: restart nagios + +- name: configure nagios services + copy: src=ansible-managed-services.cfg dest=/etc/nagios/ + +- name: create the nagios object files + template: src={{ item + ".j2" }} + dest=/etc/nagios/ansible-managed/{{ item }} + with_items: + - webservers.cfg + - dbservers.cfg + - lbservers.cfg + notify: restart nagios + +- name: start nagios + service: name=nagios state=started enabled=yes |