| name | lan-node-setup |
| description | Add LAN hosts, env variables, inventory setup, bootstrap flow for Proxmox nodes behind OpenWrt. |
LAN Node Setup
Adding a new LAN node
- Physical setup: connect node to LAN switch behind OpenWrt
- Discover node from primary:
ssh root@10.10.10.1 'cat /tmp/dhcp.leases'
for i in $(seq 200 220); do ping -c1 -W1 10.10.10.$i &>/dev/null && echo 10.10.10.$i; done
- Set up SSH key auth (one time):
ssh -L 8007:<node-ip>:8006 root@192.168.86.201
ssh-copy-id -o ProxyJump=root@192.168.86.201 root@<node-ip>
- Add env var:
<INVENTORY_HOSTNAME>_API_TOKEN= to .env/test.env
- Add to inventory: inventory/hosts.yml under lan_hosts
- Create host_vars: inventory/host_vars/nodename.yml with ansible_host
- Run bootstrap: tasks/bootstrap_lan_host.yml during converge
- Verify:
ssh -o ProxyJump=root@$PRIMARY_HOST root@<node-ip> hostname
Environment variable convention
PRIMARY_HOST=192.168.86.201
HOME_API_TOKEN=cab59c9a-...
MESH1_API_TOKEN=39d2976f-...
Convention: <INVENTORY_HOSTNAME>_API_TOKEN (uppercased, hyphens → underscores).
Dynamic resolution in group_vars:
proxmox_api_token_secret: >-
{{ lookup('env', (inventory_hostname | upper | replace('-', '_')) + '_API_TOKEN') }}
Inventory layout
proxmox:
children:
lan_hosts:
hosts:
mesh1: {}
ansible_host: 10.10.10.210
ansible_user: root
Bootstrap flow (tasks/bootstrap_lan_host.yml)
Called from primary host (router_nodes):
- Verifies SSH key auth — fails with setup instructions if not working
- Creates DHCP static lease on OpenWrt (if missing)
- Creates API token on LAN host (if missing)
- Saves token to test.env on controller
Molecule scenario for LAN nodes
platforms:
- name: home
groups: [proxmox, router_nodes]
- name: mesh1
groups: [proxmox, lan_hosts]
provisioner:
env:
HOME_API_TOKEN: ${HOME_API_TOKEN}
PRIMARY_HOST: ${PRIMARY_HOST}
MESH1_API_TOKEN: ${MESH1_API_TOKEN}
Test sequence: dependency → syntax → converge → verify → cleanup
(no initial cleanup — baseline must exist)
Baseline workflow
LAN nodes only reachable when OpenWrt baseline running:
molecule converge
molecule verify
molecule converge -s mesh1-infra
molecule verify -s mesh1-infra
molecule test
molecule converge
DHCP lease issues
If node gets different IP after router reboot, static lease may not be committed:
ssh root@10.10.10.1 'uci show dhcp | grep mesh1'
API token issues
List tokens: pveum user token list root@pam
Create: pveum user token add root@pam ansible --privsep=0
Save to test.env: MESH1_API_TOKEN=<value>