add nagios to docker if exists
This commit is contained in:
parent
28089bcd39
commit
a690343336
1 changed files with 12 additions and 10 deletions
|
@ -1,13 +1,15 @@
|
||||||
---
|
---
|
||||||
# - name: Ensure Nagios is configured
|
- name: Check if docker group exists
|
||||||
# template:
|
shell: grep docker /etc/groups
|
||||||
# dest: /etc/nagios4/nagios.cfg
|
register: docker_group
|
||||||
# src: templates/nagios.cfg.j2
|
|
||||||
# owner: "{{ nagios_user }}"
|
- name: Add nagios to docker group if it exists
|
||||||
# group: "{{ nagios_group }}"
|
user:
|
||||||
# mode: 0660
|
name: nagios
|
||||||
# backup: yes
|
append: true
|
||||||
# notify: Restart Nagios4
|
groups:
|
||||||
|
- docker
|
||||||
|
when: docker_group.rc == 0
|
||||||
|
|
||||||
- name: Ensure folder for Nagios configurations exists
|
- name: Ensure folder for Nagios configurations exists
|
||||||
file:
|
file:
|
||||||
|
|
Loading…
Reference in a new issue