# 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)