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
|
||||
# template:
|
||||
# dest: /etc/nagios4/nagios.cfg
|
||||
# src: templates/nagios.cfg.j2
|
||||
# owner: "{{ nagios_user }}"
|
||||
# group: "{{ nagios_group }}"
|
||||
# mode: 0660
|
||||
# backup: yes
|
||||
# notify: Restart Nagios4
|
||||
- name: Check if docker group exists
|
||||
shell: grep docker /etc/groups
|
||||
register: docker_group
|
||||
|
||||
- name: Add nagios to docker group if it exists
|
||||
user:
|
||||
name: nagios
|
||||
append: true
|
||||
groups:
|
||||
- docker
|
||||
when: docker_group.rc == 0
|
||||
|
||||
- name: Ensure folder for Nagios configurations exists
|
||||
file:
|
||||
|
@ -134,4 +136,4 @@
|
|||
systemd:
|
||||
name: nagios4
|
||||
enabled: yes
|
||||
state: started
|
||||
state: started
|
||||
|
|
Loading…
Reference in a new issue