fix(groups): Always ensure groups exist before assigning users
This commit is contained in:
parent
e0d88a9ee1
commit
d6636d5b09
2 changed files with 17 additions and 3 deletions
|
|
@ -2,6 +2,12 @@
|
|||
hosts: target_system
|
||||
become: true
|
||||
tasks:
|
||||
- name: Ensure user groups all exist
|
||||
ansible.builtin.group:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop: "{{ user_groups }}"
|
||||
|
||||
- name: Enable sudo for "wheel" group
|
||||
ansible.builtin.lineinfile:
|
||||
path: "/etc/sudoers"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue