2016-12-14 17:57:19 +00:00
|
|
|
---
|
|
|
|
- name: Add monitoring group
|
|
|
|
group:
|
|
|
|
name: "{{ monitored_group }}"
|
|
|
|
system: yes
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Add monitoring user
|
|
|
|
user:
|
|
|
|
name: "{{ monitored_user }}"
|
|
|
|
system: yes
|
|
|
|
group: "{{ monitored_group }}"
|
|
|
|
home: "{{ monitored_homedir }}"
|
|
|
|
move_home: yes
|
|
|
|
shell: "{{ monitored_shell }}"
|
|
|
|
state: present
|
|
|
|
|
2018-10-18 10:19:29 +00:00
|
|
|
- name: "Install sudo (if required)"
|
|
|
|
package:
|
|
|
|
name: sudo
|
|
|
|
state: latest
|
|
|
|
when: monitored_sudo_commands|default([]) != []
|
|
|
|
|
|
|
|
- name: Add sudo entries
|
|
|
|
lineinfile:
|
|
|
|
path: "{{ monitored_sudo_file }}"
|
|
|
|
line: "{{ item }}"
|
|
|
|
create: yes
|
|
|
|
backup: yes
|
|
|
|
with_items: "{{ monitored_sudo_commands|default([]) }}"
|
|
|
|
|