Assign Ansible user a group based on distro

This commit is contained in:
Salt 2020-09-02 21:57:46 -05:00
parent 08f7947d4d
commit af1d6d7905

View File

@ -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"