diff --git a/roles/pi_standard_setup/tasks/main.yml b/roles/pi_standard_setup/tasks/main.yml index d9f29de..e1eb43c 100644 --- a/roles/pi_standard_setup/tasks/main.yml +++ b/roles/pi_standard_setup/tasks/main.yml @@ -32,6 +32,25 @@ path: /etc/ssh/sshd_config.d/rename_user.conf state: absent notify: Restart sshd +- name: Check for the Raspberry Pi first-boot user wizard + ansible.builtin.stat: + path: /lib/systemd/system/userconfig.service + register: pi_standard_setup_userconfig + +- name: Disable the Raspberry Pi first-boot user wizard + # Removing the SSH banner above only hides the symptom. The wizard itself is a + # Type=oneshot unit that runs `whiptail --inputbox "Which user would you like to + # rename:"` on tty8 and waits for an answer that never comes on a headless box - it + # sits in "activating" forever. Because it is WantedBy=multi-user.target, that target + # never finishes activating either, and every unit ordered After=multi-user.target + # (musicmouse.service among them) gets a start job that queues behind it and hangs. + # The pi user already exists on these images, so there is nothing for it to do. + ansible.builtin.systemd: + name: userconfig.service + state: stopped + enabled: false + masked: true + when: pi_standard_setup_userconfig.stat.exists - name: Get hostname ansible.builtin.command: "raspi-config nonint get_hostname" register: pi_standard_setup_pi_hostname