Seed Inventory

Seed Inventory #

Before any host can be PXE booted, its definition must exist in the Ansible inventory. MAC addresses, IP assignments, DNS records, and DHCP reservations are all driven from host_vars.

Repository: ansible-inventory-deevnet


When This Is Required #

ScenarioAction
Capacity expansionAdd host to hosts.yml, create new host_vars/<hostname>.yml
Hardware replacementUpdate MAC address in existing host_vars/<hostname>.yml
Greenfield buildAll hosts need both steps

Inventory Structure #

ansible-inventory-deevnet/
└── dvntm/
    ├── hosts.yml           # Main inventory (hosts and group memberships)
    ├── group_vars/         # Variables by group
    └── host_vars/          # Per-host variables (MAC, IP, DNS, DHCP)
        ├── hv01.yml
        ├── hv02.yml
        └── ...

Adding a New Host (Expansion) #

1. Add to hosts.yml #

Add the hostname to appropriate groups:

hypervisors:
  hosts:
    hv01: {}
    hv02: {}
    hv03: {}    # new host

2. Create host_vars file #

Create host_vars/<hostname>.yml with infrastructure and environment data:

infrastructure:
  form: hv
  interfaces:
    eth0:
      mac: "aa:bb:cc:dd:ee:ff"

env:
  interfaces:
    eth0:
      ip: 192.168.10.23
      purpose: mgmt
      segment: management
      dns:
        host_a_record: true
        dhcp_reservation: true
        cnames:
          - pve3

3. Apply configuration #

cd ~/dvnt/ansible-collection-deevnet.builder
make rebuild
ansible-playbook playbooks/site.yml --limit bootstrap_nodes

This generates PXE configs and pushes DNS/DHCP to Core Router.


Updating for Hardware Replacement #

When replacing hardware (new NIC = new MAC address), update the existing host_vars file:

infrastructure:
  interfaces:
    eth0:
      mac: "new:ma:ca:dd:re:ss"   # updated MAC

Then apply configuration as above.


Host Variables Reference #

PathPurpose
infrastructure.formDevice type (hv, rt, sw, ap, etc.)
infrastructure.interfaces.<iface>.macMAC address
env.interfaces.<iface>.ipIP address (or dhcp)
env.interfaces.<iface>.segmentNetwork segment name
env.interfaces.<iface>.dns.host_a_recordCreate DNS A record
env.interfaces.<iface>.dns.dhcp_reservationCreate DHCP reservation
env.interfaces.<iface>.dns.cnamesList of CNAME aliases
Page last modified: January 23, 2026