dhcp_provisioner is a role to build and deploy a DHCP configuration file to support Zero Touch Provisioning with Arista EOS devices.
The role supports two modes:
Offlinemode let you generate a configuration you can apply on your DHCP server after carefully reviewing it.
Onlinemode lets you generate and push configuration to CloudVision, RHEL, or Ubuntu-based Linux systems.
This role requires installing the
arista.cvp collection to support CloudVision interactions.
Role Inputs and Outputs¶
An entry must be part of the inventory to describe DHCP server.
Variables dedicated to DHCP device¶
fabric_group: Ansible group where devices are defined per type.
ztp_network_summary: Subnet where DHCP will listen for request.
ztp_pool_start: First IP available in the pool.
ztp_pool_end: Last IP available in the pool.
ztp_lease_time: Maximum lease time before devices lose IP. Renewal is max/2 (default is 300 sec).
ztp_mac_source: Define which mac-address field is used for identification: interface mac-address (
interface) or system-mac-address (
ztp_mode: Define how role works either
--- - name: Build Switch configuration hosts: TOOLS connection: local gather_facts: false tasks: - name: Create dhcp configuration file import_role: name: arista.avd.dhcp_provisioner vars: ztp_network_summary: 10.73.1.0/24 ztp_pool_start: 10.73.1.200 ztp_pool_end: 10.73.1.210 ztp_lease_time: 300 fabric_group: 'DC1_FABRIC' ztp_mac_source: system
This module also reads information from the fabric definition. For any node defined under spine, l3leaf, and l2leaf, the role generates a DHCP entry if mac-address is found. Entry is based on the following fields:
mgmt_ip: Management IP set as per
mac_address: MAC address used for DHCP. It can be either interface mac-address or system-mac-address.
This module also uses the
cvp_instance_ips knobs to set correct registration URL. In case you need to extend the TerminAttr daemon, you should use an approach similar to the following code:
cvp_instance_ips: - < cvp instance 01 > - < cvp instance 02 > - < cvp instance 03 > cvp_ingestauth_key: < Fake ingest key overwritten by custom_structured_configuration > # CloudVision server information custom_structured_configuration_daemon_terminattr: cvauth: method: "token" token_file: "< path to the token file >"
- DHCP configuration file under
- Generate structured configuration for DHCP configuration as documented in
- Load generated variables.
- Create DHCP configuration file.
- If mode is online, apply configuration to DHCP server.
Requirements are located here: avd-requirements
Project is published under Apache 2.0 License