Mac: automatic login for phil

The Mac powers back on after a power cut but stopped at the login window,
so nothing that needs a login session (dashboard, Podman VM for Hermes's
sandbox, BlueBubbles, Beeper) came back. Turn on automatic login with
sysadminctl, using phil's password from the vault. FileVault is off, so it
works unattended. User accepted the physical-access trade-off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-11 07:34:26 -07:00
1 parent 3036fa2d74
commit bad2426896
3 files changed
+29

No files matched your search

+4
View File
@@ -40,6 +40,10 @@ Manages cogitator-02, an Apple Silicon Mac on the tailnet (`mac.yml`,
copied to `~/.hermes/scripts/`. Missing jobs are created; existing ones are copied to `~/.hermes/scripts/`. Missing jobs are created; existing ones are
left as they are. Today: `hermes-update-notice`, which messages you on left as they are. Today: `hermes-update-notice`, which messages you on
Telegram on Mondays only when a new stable Hermes release is out. Telegram on Mondays only when a new stable Hermes release is out.
- **Automatic login** (tag `autologin`): phil is logged in automatically after
a reboot, so everything that needs a login session (dashboard, Podman VM,
BlueBubbles, Beeper) comes back after a power cut. Uses phil's password from
the vault; redeploy after changing it.
Ansible logs in as `phil`. sudo needs phil's password, which is in the vault Ansible logs in as `phil`. sudo needs phil's password, which is in the vault
as `vault_cogitator02.become_password`; only tasks with `become: true` use it. as `vault_cogitator02.become_password`; only tasks with `become: true` use it.
+21
View File
@@ -0,0 +1,21 @@
# Log phil in automatically after a reboot (the Mac powers itself back on
# after a power cut): the dashboard, the Podman VM, BlueBubbles and Beeper
# all need a login session. FileVault is off, so this works unattended.
# It uses phil's login password from the vault; if that password changes,
# update vault_cogitator02.become_password and redeploy.
- name: Read automatic login
ansible.builtin.command:
argv: [sysadminctl, -autologin, status]
register: autologin_status
changed_when: false
check_mode: false
- name: Turn on automatic login for {{ ansible_user }}
ansible.builtin.command:
argv: [sysadminctl, -autologin, set, -userName, "{{ ansible_user }}",
-password, "{{ vault_cogitator02.become_password }}"]
become: true
no_log: true
when: >-
(autologin_status.stdout ~ autologin_status.stderr)
is not search('Automatic login is ON.*' ~ ansible_user, ignorecase=true)
+4
View File
@@ -45,3 +45,7 @@
- name: Podman VM - name: Podman VM
ansible.builtin.import_tasks: podman.yml ansible.builtin.import_tasks: podman.yml
tags: podman tags: podman
- name: Automatic login
ansible.builtin.import_tasks: autologin.yml
tags: autologin