packer: fixing networking

This commit is contained in:
Kyle Isom 2023-04-14 16:34:58 -07:00
parent 10be9bac41
commit f0abff9f6a
10 changed files with 45 additions and 57 deletions

View File

@ -59,8 +59,8 @@
"type": "file"
},
{
"destination": "/etc/systemd/system/tailscale.service",
"source": "files/tailscale.service",
"destination": "/etc/netplan/10-network.yaml",
"source": "files/network-dev.yaml",
"type": "file"
},
{

View File

@ -48,6 +48,11 @@
"source": "files/user-data_cnode",
"type": "file"
},
{
"destination": "/etc/netplan/10-network.yaml",
"source": "files/netplan-node.yaml",
"type": "file"
},
{
"scripts": [
"scripts/setup-base.sh",

View File

@ -0,0 +1,14 @@
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: yes
dhcp6: yes
eth1:
dhcp4: no
dhcp6: no
addresses:
- "192.168.4.64/24"
# dev nodes may also use wireless, which requires serial console to setup.

View File

@ -0,0 +1,7 @@
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: yes
dhcp6: yes

View File

@ -1,18 +0,0 @@
[Unit]
Description=Tailscale
Documentation=https://tailscale.com/kb/
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/bin/tailscaled
[Service]
User=root
Group=root
ExecStart=/usr/bin/tailscale up --advertise-routes=192.168.4.1/24
ExecStop=
# Let systemd restart this service always
Restart=always
[Install]
WantedBy=multi-user.target

View File

@ -5,11 +5,9 @@
chpasswd:
expire: false
list:
- name: ubuntu
password: ubuntu
type: text
- ubuntu:ubuntu
hostname: cluster-cdev
hostname: cdev
ssh_pwauth: true
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM47gCbb0BQOm6H4Ol8DEKD+CXTNYDJxe7QvJhdLZR/F kyle@petrichor
@ -24,17 +22,21 @@ disable_root: true
resize_rootfs: true
network:
Version: 2
Renderer: networkd
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses:
"192.168.4.64/24"
label: "cluster"
lifetime: forever
- 192.168.4.64/24
eth1:
dhcp4: yes
dhcp6: yes
wifis:
wlan0:
dhcp4: yes
dhcp6: yes
access-points:
"ATTjrThnDS":
password: "b#ifs9zv5epx"

View File

@ -5,9 +5,7 @@
chpasswd:
expire: false
list:
- name: ubuntu
password: ubuntu
type: text
- ubuntu:ubuntu
hostname: node16
ssh_pwauth: true
@ -23,10 +21,3 @@ disable_root: true
resize_rootfs: true
network:
Version: 2
Renderer: networkd
ethernets:
eth0:
dhcp4: yes
dhcp6: yes

View File

@ -6,6 +6,3 @@ export DEBIAN_FRONTEND=noninteractive
echo "[+] installing cdev node packages"
apt-get --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y install dnsmasq picocom wpasupplicant
echo "[+] installing tailscale"
curl -fsSL https://tailscale.com/install.sh | sh

View File

@ -2,17 +2,5 @@
set -euxo pipefail
source /etc/os-release
case "${ID}" in
ubuntu)
SYSTEM_USER=ubuntu
SYSTEM_HOME=/home/${SYSTEM_USER}
;;
*)
SYSTEM_USER=root
SYSTEM_HOME=/root
;;
esac
apt-get -y install openssh-server

View File

@ -5,6 +5,8 @@ boards:
files:
- source: files/user-data_cnode
destination: /boot/firmware/user-data
- source: files/netplan-node.yaml
destination: /etc/netplan/10-network.yaml
scripts:
- scripts/setup-base.sh
- scripts/setup-ssh.sh
@ -18,8 +20,8 @@ boards:
destination: /etc/hosts
- source: files/dnsmasq.conf
destination: /etc/dnsmasq.conf
- source: files/tailscale.service
destination: /etc/systemd/system/tailscale.service
- source: files/netplan-dev.yaml
destination: /etc/netplan/10-network.yaml
scripts:
- scripts/setup-base.sh
- scripts/setup-ssh.sh