Refactor Ansible tasks and templates for improved consistency and clarity
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
validate: visudo -cf %s
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0440
|
||||
mode: "0440"
|
||||
tags:
|
||||
- sudoers-file-configuration
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
dest: /etc/sudoers
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0440
|
||||
mode: "0440"
|
||||
validate: visudo -cf %s
|
||||
tags:
|
||||
- sudoers-global-configuration
|
||||
|
||||
#- name: (sudoers-pc.yml) Ensure all sudo_users are in sudo group
|
||||
# - name: (sudoers-pc.yml) Ensure all sudo_users are in sudo group
|
||||
# user:
|
||||
# name: "{{ item }}"
|
||||
# groups: sudo
|
||||
@@ -32,7 +32,10 @@
|
||||
# - sudo-users
|
||||
|
||||
- name: (sudoers-pc.yml) Ensure all sudo_users are in sudo group
|
||||
shell: usermod -a -G sudo "{{ item }}"
|
||||
ansible.builtin.user:
|
||||
name: "{{ item }}"
|
||||
groups: sudo
|
||||
append: true
|
||||
with_items: "{{ sudo_pc_users }}"
|
||||
tags:
|
||||
- sudo-users
|
||||
|
||||
Reference in New Issue
Block a user