From 524e059bbed05e09b609c985c921a8c5b9917fce Mon Sep 17 00:00:00 2001 From: Gildas Le Nadan <3ntr0p13+github@gmail.com> Date: Sat, 28 Dec 2024 12:22:59 +1000 Subject: [PATCH] Following changes in raspberrypios bullseye, there is a new mechanism to set password to user pi (see https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022/) To avoid the pop-up asking for rename and still deactivate the user pi, creating a file /boot/userconf.txt with pi:* instead of changing the password directly. --- goss/goss_system.yaml | 6 ++++++ tasks/system.yaml | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/goss/goss_system.yaml b/goss/goss_system.yaml index 5df38d3..c406786 100644 --- a/goss/goss_system.yaml +++ b/goss/goss_system.yaml @@ -27,6 +27,12 @@ file: contents: [ 'root=/dev/mmcblk0p2' ] + /boot/userconf.txt: + exists: true + owner: root + group: root + filetype: file + contents: 'pi:*' command: 'rootfs label': exit-status: 0 diff --git a/tasks/system.yaml b/tasks/system.yaml index 9d7027d..304be03 100755 --- a/tasks/system.yaml +++ b/tasks/system.yaml @@ -15,9 +15,11 @@ line: PermitRootLogin yes - name: Disable pi user - user: - name: pi - password: '*' + copy: + content: 'pi:*' + dest: /boot/userconf.txt + owner: root + group: root - name: Make sure disk resize is not automatically set for first boot file: