Files
ansible/roles/pi_standard_setup/tasks/main.yml
Martin Bauer 2443a75871 Keep /etc/hosts 127.0.1.1 in sync with the hostname
raspi-config's do_hostname rewrites the 127.0.1.1 line with
  sed "s/127\.0\.1\.1.*$CURRENT_HOSTNAME/127.0.1.1\t$NEW_HOSTNAME/"
which only matches if that line already holds the *old* hostname. Ours
still said "raspberrypi", so the substitution has been silently doing
nothing and the box could not resolve its own hostname.

Set the line explicitly instead, after the hostname is re-read, so a
rename and this update happen in the same run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 16:31:12 +02:00

5.4 KiB