Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ansible/ansible-examples.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lamp_haproxy/aws/roles/nagios/tasks/main.yml')
-rw-r--r--lamp_haproxy/aws/roles/nagios/tasks/main.yml25
1 files changed, 18 insertions, 7 deletions
diff --git a/lamp_haproxy/aws/roles/nagios/tasks/main.yml b/lamp_haproxy/aws/roles/nagios/tasks/main.yml
index 69e2d43..601fcc7 100644
--- a/lamp_haproxy/aws/roles/nagios/tasks/main.yml
+++ b/lamp_haproxy/aws/roles/nagios/tasks/main.yml
@@ -2,7 +2,9 @@
# This will install nagios
- name: install nagios
- yum: pkg={{ item }} state=present
+ yum:
+ pkg: "{{ item }}"
+ state: present
with_items:
- nagios
- nagios-plugins
@@ -15,22 +17,31 @@
notify: restart httpd
- name: create nagios config dir
- file: path=/etc/nagios/ansible-managed state=directory
+ file:
+ path: /etc/nagios/ansible-managed
+ state: directory
- name: configure nagios
- copy: src=nagios.cfg dest=/etc/nagios/nagios.cfg
+ 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
+ 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/
+ 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 }}
+ template:
+ src: "{{ item + .j2 }}"
+ dest: "/etc/nagios/ansible-managed/{{ item }}"
with_items:
- webservers.cfg
- dbservers.cfg