ref(playbook): Change to role-based structure
This commit is contained in:
parent
95fd68bed8
commit
b3b280fbe4
39 changed files with 635 additions and 601 deletions
27
roles/user/tasks/main.yaml
Normal file
27
roles/user/tasks/main.yaml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
- name: Enable sudo access for "wheel" group
|
||||
ansible.builtin.copy:
|
||||
content: "%wheel ALL=(ALL) ALL"
|
||||
dest: "/etc/sudoers.d/10-wheel"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
force: true
|
||||
tags: sudo
|
||||
|
||||
- name: Ensure all desired user groups exist
|
||||
ansible.builtin.group:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop: "{{ user_groups }}"
|
||||
|
||||
- name: Add primary user
|
||||
ansible.builtin.user:
|
||||
name: "{{ user_name }}"
|
||||
password: "{{ user_pass | password_hash('sha512', '{{ user_pass_salt}}') }}"
|
||||
create_home: true
|
||||
shell: "/bin/{{ user_shell }}"
|
||||
group: "{{ user_name }}"
|
||||
groups: "{{ user_groups }}"
|
||||
generate_ssh_key: true
|
||||
tags:
|
||||
- passlib
|
||||
18
roles/user/vars/main.yaml
Normal file
18
roles/user/vars/main.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
user_pass_salt: supersecretsalt
|
||||
user_name: voidboi
|
||||
user_pass: voidlinux
|
||||
user_shell: zsh
|
||||
user_shell: zsh
|
||||
user_groups:
|
||||
- wheel
|
||||
- _seatd # TODO: This will error if it does not exist? (seatd not installed)
|
||||
- dialout
|
||||
- disk
|
||||
- input
|
||||
- kvm
|
||||
- lp
|
||||
- plugdev
|
||||
- scanner
|
||||
- storage
|
||||
- usbmon
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue