Assign Ansible user a group based on distro
This commit is contained in:
parent
08f7947d4d
commit
af1d6d7905
@ -5,10 +5,19 @@
|
||||
- name: Create Ansible system user
|
||||
user:
|
||||
name: ansible
|
||||
groups: sudo
|
||||
password_lock: yes
|
||||
system: yes
|
||||
become: yes
|
||||
- name: Enroll Ansible user in sudo
|
||||
user:
|
||||
name: ansible
|
||||
groups: sudo
|
||||
when: ansible_distribution == "Ubuntu"
|
||||
- name: Enroll Ansible user in wheel
|
||||
user:
|
||||
name: ansible
|
||||
groups: wheel
|
||||
when: ansible_distribution != "Ubuntu"
|
||||
- name: Ensure perms on Ansible user home
|
||||
file:
|
||||
path: "/home/ansible"
|
||||
|
Loading…
Reference in New Issue
Block a user