From 7d92af47eda7be65b307a285e7ef4a25d53158d9 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 28 May 2024 23:24:15 +0200 Subject: ch-cm4-sensor: make install in iot possible --- roles/installer/raspios/image/templates/firstrun.sh.j2 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'roles/installer/raspios/image') diff --git a/roles/installer/raspios/image/templates/firstrun.sh.j2 b/roles/installer/raspios/image/templates/firstrun.sh.j2 index 96c74b39..05f9639d 100644 --- a/roles/installer/raspios/image/templates/firstrun.sh.j2 +++ b/roles/installer/raspios/image/templates/firstrun.sh.j2 @@ -76,8 +76,10 @@ EOF {% if not (install_dhcp | default(false)) %} cat < /etc/resolv.conf # Generated by ansible +{% if 'domain' in network %} search {{ network.domain }} -{% for nameserver in network.nameservers %} +{% endif %} +{% for nameserver in (network.nameservers | default([])) %} nameserver {{ nameserver }} {% endfor %} EOF @@ -86,6 +88,9 @@ systemctl disable wpa_supplicant.service rfkill unblock wlan ifup {{ network.primary.name }} {% endif %} +{% for host in (network.static_hostnames | default([])) %} +echo "{{ host.address }} {{ host.names | join(' ') }}" >> /etc/hosts +{% endfor %} {% if ansible_port != 22 %} sed -e 's/^\s*#*\s*Port\s\s*[0-9][0-9]*$/Port {{ ansible_port }}/' -i /etc/ssh/sshd_config @@ -108,6 +113,13 @@ rm "$FW_LOC/firstrun.sh" rm -f /etc/sudoers.d/010_pi-nopasswd rm -f /etc/apt/sources.list.d/vscode.list rm -f /etc/apt/trusted.gpg.d/microsoft.gpg +rm -f /etc/apt/sources.list.d/raspi.list +cat < /etc/apt/sources.list +deb http://{{ apt_repo_providers[apt_repo_provider].debian.host }}{{ apt_repo_providers[apt_repo_provider].debian.path }} {{ install_codename }} main non-free-firmware +deb http://{{ apt_repo_providers[apt_repo_provider].debian.host }}{{ apt_repo_providers[apt_repo_provider].debian.path }} {{ install_codename }}-updates main non-free-firmware +deb http://{{ apt_repo_providers[apt_repo_provider].debian_security.host }}{{ apt_repo_providers[apt_repo_provider].debian_security.path }} {{ install_codename }}-security main non-free-firmware +deb http://{{ apt_repo_providers[apt_repo_provider].raspios.host }}{{ apt_repo_providers[apt_repo_provider].raspios.path }} {{ install_codename }} main +EOF apt-get update -q apt-get dist-upgrade -y -q -- cgit v1.2.3