Files
ssd_health/tasks/autologin.yaml
2025-11-02 15:20:34 -08:00

50 lines
1.3 KiB
YAML

---
- name: autologin - edit logind to reduce vterms to one
lineinfile:
dest: /etc/systemd/logind.conf
regexp: '^#NAutoVTs=6'
line: 'NAutoVTs=1'
backrefs: yes
- name: autologin - create getty tty1 service folder
file:
path: /etc/systemd/system/getty@tty1.service.d/
state: directory
mode: '0700'
- name: autologin - "create {{ autologin_user }} .bashrc"
copy:
#dest: "/home/{{ autologin_user }}/.bash_aliases"
dest: "/home/{{ autologin_user }}/.bash_aliases"
owner: "{{ autologin_user }}"
group: "{{ autologin_user }}"
mode: '0600'
content: |
clear
cat {{ service_folder }}/hello-there.txt
sleep 4
{{ service_folder }}/drive_check.sh
- name: autologin - add autologin override to getty tty1 service
copy:
dest: /etc/systemd/system/getty@tty1.service.d/override.conf
content: |
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin {{ autologin_user }} --noclear %I 38400 linux
# create hello_there ASCII art
- name: autologin - generate hello_there.txt for the lulz
when: not quick_refresh | bool
include_tasks: hello_there.yaml
- name: autologin - Restart getty@tty1 service
systemd:
name: getty@tty1.service
state: restarted
enabled: true
masked: false
daemon_reload: true
...