Init commit

This commit is contained in:
2025-11-02 13:11:42 -08:00
commit 650b481463
16 changed files with 983 additions and 0 deletions

37
tasks/user_setup.yaml Normal file
View File

@ -0,0 +1,37 @@
---
- name: "User setup - create {{ autologin_user }} user"
user:
name: "{{ autologin_user }}"
groups: disk
password: "{{ autologin_password | password_hash('sha512') }}"
shell: /bin/bash
- name: "User setup - ensure {{ autologin_user }} home folder exists"
file:
path: "/home/{{ autologin_user }}"
state: directory
owner: "{{ autologin_user }}"
group: "{{ autologin_user }}"
mode: '0700'
- name: User setup - update permissions on smartctl & fdisk
shell: |
chmod 755 /usr/sbin/smartctl
chmod u+s /usr/sbin/smartctl
chmod u+s /usr/sbin/fdisk
- name: User setup - create symlink for smartctl & fdisk
ignore_errors: yes
shell: |
ln /usr/sbin/smartctl /usr/bin/smartctl
ln /usr/sbin/fdisk /usr/bin/fdisk
- name: "User setup - allow {{ autologin_user }} to smartctl"
copy:
dest: /etc/sudoers.d/smartctl
content: |
{{ autologin_user }} ALL=(ALL) NOPASSWD: /usr/sbin/smartctl
{{ autologin_user }} ALL=(ALL) NOPASSWD: /usr/sbin/fdisk
...