Add sudo entries
This commit is contained in:
parent
66e132063c
commit
ab8d92a139
|
@ -15,3 +15,18 @@
|
||||||
shell: "{{ monitored_shell }}"
|
shell: "{{ monitored_shell }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
|
- 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([]) }}"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue