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
|
- name: Create Ansible system user
|
||||||
user:
|
user:
|
||||||
name: ansible
|
name: ansible
|
||||||
groups: sudo
|
|
||||||
password_lock: yes
|
password_lock: yes
|
||||||
system: yes
|
system: yes
|
||||||
become: 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
|
- name: Ensure perms on Ansible user home
|
||||||
file:
|
file:
|
||||||
path: "/home/ansible"
|
path: "/home/ansible"
|
||||||
|
Loading…
Reference in New Issue
Block a user