summaryrefslogtreecommitdiff
path: root/roles
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2023-06-11 23:14:12 +0200
committerChristian Pointner <equinox@spreadspace.org>2023-06-11 23:14:40 +0200
commit56e50ecd109f7feadd605c8056daf8d9717cdaa5 (patch)
tree0bd10a5ef462feacb2bd79230de8bead36ddcd12 /roles
parentupdate wpa supplicant config (diff)
add test host for raspi zeroW
Diffstat (limited to 'roles')
-rw-r--r--roles/raspios/image/templates/firstrun.sh.j26
1 files changed, 5 insertions, 1 deletions
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 <<EOF >> /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