You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
ansible-role-nginx/lamp_haproxy/roles/nagios/tasks/main.yml

41 lines
1021 B

---
# This will install nagios
- name: install nagios
yum: pkg=$item state=installed
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