packer: fixing networking
This commit is contained in:
parent
10be9bac41
commit
f0abff9f6a
|
@ -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"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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.
|
|
@ -0,0 +1,7 @@
|
|||
network:
|
||||
version: 2
|
||||
renderer: networkd
|
||||
ethernets:
|
||||
eth0:
|
||||
dhcp4: yes
|
||||
dhcp6: yes
|
|
@ -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
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue