forked from ISTI-ansible-roles/ansible-roles
Merge branch 'master' of adellam/ansible-roles into master
This commit is contained in:
commit
05984c2968
|
@ -33,19 +33,28 @@
|
||||||
- name: Install the global nrpe commands file
|
- name: Install the global nrpe commands file
|
||||||
template: src=common-nrpe.cfg.j2 dest=/etc/nagios/nrpe.d/common.cfg owner=root group=root mode=444
|
template: src=common-nrpe.cfg.j2 dest=/etc/nagios/nrpe.d/common.cfg owner=root group=root mode=444
|
||||||
notify: Restart NRPE server
|
notify: Restart NRPE server
|
||||||
|
register: nrpe_restart
|
||||||
tags: [ 'nagios', 'nrpe', 'nrpe_cfg' ]
|
tags: [ 'nagios', 'nrpe', 'nrpe_cfg' ]
|
||||||
|
|
||||||
- name: set the NRPE ACL
|
- name: set the NRPE ACL
|
||||||
action: |
|
action: |
|
||||||
lineinfile name=/etc/nagios/nrpe.cfg regexp="allowed_hosts=" line="allowed_hosts=127.0.0.1,{% for ip in nagios_monitoring_server_ip %}{{ ip }}{%if not loop.last %},{% endif %}{% endfor %}"
|
lineinfile name=/etc/nagios/nrpe.cfg regexp="allowed_hosts=" line="allowed_hosts=127.0.0.1,{% for ip in nagios_monitoring_server_ip %}{{ ip }}{%if not loop.last %},{% endif %}{% endfor %}"
|
||||||
notify: Reload NRPE server
|
notify: Reload NRPE server
|
||||||
|
register: nrpe_restart
|
||||||
tags: [ 'nagios', 'nrpe', 'nrpe_cfg' ]
|
tags: [ 'nagios', 'nrpe', 'nrpe_cfg' ]
|
||||||
|
|
||||||
- name: set the NRPE default timeout
|
- name: set the NRPE default timeout
|
||||||
lineinfile: name=/etc/nagios/nrpe.cfg regexp="command_timeout=" line="command_timeout={{ nrpe_command_timeout }}"
|
lineinfile: name=/etc/nagios/nrpe.cfg regexp="command_timeout=" line="command_timeout={{ nrpe_command_timeout }}"
|
||||||
notify: Reload NRPE server
|
notify: Reload NRPE server
|
||||||
|
register: nrpe_restart
|
||||||
tags: [ 'nagios', 'nrpe', 'nrpe_cfg' ]
|
tags: [ 'nagios', 'nrpe', 'nrpe_cfg' ]
|
||||||
|
|
||||||
|
- name: Restart NRPE server
|
||||||
|
service: name=nagios-nrpe-server state=restarted
|
||||||
|
when:
|
||||||
|
- nrpe_restart is defined
|
||||||
|
- nrpe_restart is changed
|
||||||
|
|
||||||
- name: nagios needs root to execute some commands. We do it via sudo
|
- name: nagios needs root to execute some commands. We do it via sudo
|
||||||
template: src=nagios.sudoers.j2 dest=/etc/sudoers.d/nagios owner=root group=root mode=0440
|
template: src=nagios.sudoers.j2 dest=/etc/sudoers.d/nagios owner=root group=root mode=0440
|
||||||
tags: [ 'nagios', 'nrpe', 'sudo' ]
|
tags: [ 'nagios', 'nrpe', 'sudo' ]
|
||||||
|
|
Loading…
Reference in New Issue