Add sudo entries

This commit is contained in:
Sven Velt 2018-10-18 12:19:29 +02:00
parent 66e132063c
commit ab8d92a139

View file

@ -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([]) }}"