Merge branch 'sudo_location' into 'master'

sudo group by location

See merge request aurore/ansible!29
This commit is contained in:
Alexandre IOOSS 2019-03-23 13:52:51 +01:00
commit 8da9e10a51
2 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,3 @@
---
# Users in that group will be able to `sudo`
sudo_group_location: 'sudopacaterie'

View file

@ -16,8 +16,16 @@
until: package_result is succeeded until: package_result is succeeded
# Set sudo group # Set sudo group
- name: Configure sudoers - name: Configure sudoers sudo group
lineinfile: lineinfile:
dest: /etc/sudoers dest: /etc/sudoers
regexp: "^%{{ sudo_group }}" regexp: "^%{{ sudo_group }}"
line: "%{{ sudo_group }} ALL=(ALL:ALL) ALL" line: "%{{ sudo_group }} ALL=(ALL:ALL) ALL"
# Set sudo location group
- name: Configure sudoers sudo location group
lineinfile:
dest: /etc/sudoers
regexp: "^%{{ sudo_group_location }}"
line: "%{{ sudo_group_location }} ALL=(ALL:ALL) ALL"
when: sudo_group_location is defined