19 lines
588 B
YAML
19 lines
588 B
YAML
- name: Set up primary user
|
|
hosts: target_system
|
|
become: true
|
|
tasks:
|
|
- name: Enable sudo for "wheel" group
|
|
ansible.builtin.lineinfile:
|
|
path: "/etc/sudoers"
|
|
regexp: '^# %wheel ALL=(ALL) ALL$'
|
|
line: '%wheel ALL=(ALL) ALL'
|
|
|
|
- name: Add user
|
|
ansible.builtin.user:
|
|
name: "{{ user_name }}"
|
|
password: "{{ user_pass | password_hash('sha512', 'supersecretsalt') }}"
|
|
create_home: true
|
|
shell: "/bin/{{ user_shell }}"
|
|
group: "{{ user_name }}"
|
|
groups: "{{ user_groups }}"
|
|
generate_ssh_key: true
|