This playbook provides DHCP and a webserver for ZTP and reimaging of ONIE based switches. It's goal is to aid bootstrapping switches for further programmatic configuration, e.g. ansible.
It makes use of:
The webserver is exposed on 8080/tcp
The playbook has been tested on:
- Rocky Linux 9 host
- Migration of Cumulus Linux 5.6 -> 5.11
This met the minimum requirements, but could be improved upon Initial thoughts:
- Template ZTP script
- Move vars to ansible
- Read public key(s) from file(s)
- The playbook is expected to be run against localhost.
- Localhost sits on the same L2 domain as the switch(es).
- There are no other DHCP servers in this L2 domain.
- (Optional) The MAC address of the mgmt interface is known.
- Clone the repo
- Adjust values in defaults/main.yml
- It is suggested to delegate fixed switch IPs outside of the dynamic DHCP range. This ensures any rogue DHCP client is non-interfering.
- A venv is recommended.
python -m venv provision
source provision/bin/activate
pip install -r requirements.txt
ansible-galaxy install -r requirements.yml
- Customise the ZTP script and/or place an ONIE image in the
servedirectory
To start ansible-playbook main.yml -t start
After provisioning ansible-playbook main.yml -t stop