diff --git a/group_vars/pacaterie/sudo_location_group.yml b/group_vars/pacaterie/sudo_location_group.yml new file mode 100644 index 0000000..6244736 --- /dev/null +++ b/group_vars/pacaterie/sudo_location_group.yml @@ -0,0 +1,3 @@ +--- +# Users in that group will be able to `sudo` +sudo_group_location: 'sudopacaterie' diff --git a/roles/ldap-client/tasks/1_group_security.yml b/roles/ldap-client/tasks/1_group_security.yml index 13e3261..9e01f03 100644 --- a/roles/ldap-client/tasks/1_group_security.yml +++ b/roles/ldap-client/tasks/1_group_security.yml @@ -16,8 +16,16 @@ until: package_result is succeeded # Set sudo group -- name: Configure sudoers +- name: Configure sudoers sudo group lineinfile: dest: /etc/sudoers regexp: "^%{{ sudo_group }}" 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