From 56e50ecd109f7feadd605c8056daf8d9717cdaa5 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 11 Jun 2023 23:14:12 +0200 Subject: add test host for raspi zeroW --- roles/raspios/image/templates/firstrun.sh.j2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'roles/raspios/image/templates/firstrun.sh.j2') diff --git a/roles/raspios/image/templates/firstrun.sh.j2 b/roles/raspios/image/templates/firstrun.sh.j2 index 3166b974..65181683 100644 --- a/roles/raspios/image/templates/firstrun.sh.j2 +++ b/roles/raspios/image/templates/firstrun.sh.j2 @@ -14,7 +14,7 @@ raspi-config nonint do_net_names 1 cat <> /etc/dhcpcd.conf # -interface eth0 +interface {{ network.primary.name }} static ip_address={{ network.primary.address }} static routers={{ network.primary.gateway }} static domain_name_servers={{ network.nameservers | join(' ') }} @@ -31,7 +31,11 @@ install -m 0644 /boot/firstrun.authorized_keys /root/.ssh/authorized_keys raspi-config nonint do_ssh 0 systemctl disable hciuart.service +{% if 'wifi' in network.primary %} +raspi-config nonint do_wifi_ssid_passphrase "{{ network.primary.wifi.ssid }}" "{{ network.primary.wifi.key }}" +{% else %} systemctl disable wpa_supplicant.service +{% endif %} export DEBIAN_FRONTEND=noninteractive export SUDO_FORCE_REMOVE=yes apt-get purge -q -y userconf-pi avahi-daemon triggerhappy rsync dpkg-dev patch gdb make strace ssh-import-id network-manager udisks2 p7zip p7zip-full sudo -- cgit v1.2.3