diff --git a/tasks/configure.yml b/tasks/configure.yml index 87ceb17..d22e97b 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -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 \ No newline at end of file + state: started