feat(user): Set up user management for void
This commit is contained in:
parent
b3a13f112f
commit
a3df7eeb27
2 changed files with 35 additions and 0 deletions
|
|
@ -15,6 +15,9 @@
|
||||||
- name: Import chroot guest tasks
|
- name: Import chroot guest tasks
|
||||||
ansible.builtin.import_playbook: guest.yaml
|
ansible.builtin.import_playbook: guest.yaml
|
||||||
|
|
||||||
|
- name: Import chroot user management tasks
|
||||||
|
ansible.builtin.import_playbook: void_user.yaml
|
||||||
|
|
||||||
# - I chose to use booster instead of dracut
|
# - I chose to use booster instead of dracut
|
||||||
# - easiest way to achieve this is before installing `base-system`
|
# - easiest way to achieve this is before installing `base-system`
|
||||||
# to `echo 'ignorepkg=dracut' >> /etc/xbps.d/ignore-dracut.conf`
|
# to `echo 'ignorepkg=dracut' >> /etc/xbps.d/ignore-dracut.conf`
|
||||||
|
|
|
||||||
32
void_user.yaml
Normal file
32
void_user.yaml
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
- name: Set up primary user
|
||||||
|
hosts: guest
|
||||||
|
become: true
|
||||||
|
vars:
|
||||||
|
user_name: marty
|
||||||
|
user_pass: marty
|
||||||
|
user_shell: zsh
|
||||||
|
user_groups:
|
||||||
|
- wheel
|
||||||
|
- _seatd # TODO: This will error if it does not exist (seatd not installed)
|
||||||
|
- audio
|
||||||
|
- dialout
|
||||||
|
- disk
|
||||||
|
- input
|
||||||
|
- kvm
|
||||||
|
- lp
|
||||||
|
- plugdev
|
||||||
|
- scanner
|
||||||
|
- storage
|
||||||
|
- usbmon
|
||||||
|
- video
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- 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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue