summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inventory/group_vars/chaos-at-home/network.yml1
-rw-r--r--inventory/host_vars/ch-rpizerow-test.yml24
-rw-r--r--inventory/hosts.ini2
-rw-r--r--roles/raspios/image/templates/firstrun.sh.j26
4 files changed, 32 insertions, 1 deletions
diff --git a/inventory/group_vars/chaos-at-home/network.yml b/inventory/group_vars/chaos-at-home/network.yml
index 8f36e603..22dfbdae 100644
--- a/inventory/group_vars/chaos-at-home/network.yml
+++ b/inventory/group_vars/chaos-at-home/network.yml
@@ -31,6 +31,7 @@ network_zones:
ch-cm4-test: 34
ch-rpi4-test: 35
ch-rpi3-test: 36
+ ch-rpizerow-test: 37
ele-media: 99
ch-prometheus: 200
ch-epimetheus: 201
diff --git a/inventory/host_vars/ch-rpizerow-test.yml b/inventory/host_vars/ch-rpizerow-test.yml
new file mode 100644
index 00000000..d7bfcb2f
--- /dev/null
+++ b/inventory/host_vars/ch-rpizerow-test.yml
@@ -0,0 +1,24 @@
+---
+raspios_variant: lite
+raspios_arch: armhf
+
+network:
+ nameservers: "{{ network_zones.lan.dns }}"
+ domain: "{{ host_domain }}"
+ primary: &_network_primary_
+ name: wlan0
+ address: "{{ network_zones.lan.prefix | ansible.utils.ipaddr(network_zones.lan.offsets[inventory_hostname]) }}"
+ gateway: "{{ network_zones.lan.gateway }}"
+ wifi:
+ ssid: "{{ network_zones.lan.wifi.ssid }}"
+ key: "{{ network_zones.lan.wifi.key }}"
+ interfaces:
+ - *_network_primary_
+
+raspios_boot_config:
+ - regexp: '^#?dtparam=audio='
+ line: 'dtparam=audio=off'
+ - regexp: '^#?dtoverlay=disable-bt'
+ line: 'dtoverlay=disable-bt'
+
+base_entropy_generator: rngd
diff --git a/inventory/hosts.ini b/inventory/hosts.ini
index 894747cd..8a4084b4 100644
--- a/inventory/hosts.ini
+++ b/inventory/hosts.ini
@@ -63,6 +63,7 @@ ch-raspi-ntp
ch-cm4-test
ch-rpi4-test
ch-rpi3-test
+ch-rpizerow-test
[chaos-at-home:children]
mz-chaos-at-home
@@ -341,6 +342,7 @@ ch-router-obsd
ch-cm4-test
ch-rpi4-test
ch-rpi3-test
+ch-rpizerow-test
ch-mclr
ch-epimetheus
ele-stage-raspi
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