aristanetworks / ansible-cvp

Ansible modules for Arista CloudVision
http://cvp.avd.sh
Apache License 2.0
66 stars 61 forks source link

Feature Request - Support DHCP config outside of CVP #151

Closed noredistribution closed 4 years ago

noredistribution commented 4 years ago

Would be nice if we could specify the IP and credentials of the DHCP server, as it can run on any server, not just on CVP. For simplicity we could leave the configs as is, for ISC DHCP only, and in the future maybe we could support KEA DHCP too.

titom73 commented 4 years ago

Hello @noredistribution

Current ZTP role in development branch aims to be generic to configure a standard DHCP isc server

In your inventory, just target your own DHCP server like this:

---
all:
  children:
    MyServers:
      hosts:
        my_ztp:
          ansible_host: 1.1.1.1
          ansible_user: root
          ansible_password: password

In term of configuration, you can configure your DHCP to provide CVP URL for device registration:

vars:
    ztp:
      default:
        registration: 'http://<CVP IP Address>/ztp/bootstrap'
        gateway: 10.255.0.3
        nameservers: 
          - '10.255.0.3'
      general:
        subnets:
          - network: 10.255.0.0
            netmask: 255.255.255.0
            gateway: 10.255.0.3
            nameservers: 
              - '10.255.0.3'
            start: 10.255.0.200
            end: 10.255.0.250
            lease_time: 300
      clients:
        - name: DC1-SPINE1
          mac: 0c:1d:c0:1d:62:01
          ip4: 10.255.0.11

Note, if you want to target different ZTP url, you can use registration filed in device entries as per the documentation.

For the KEA support, happy to merge any PR related to that server implementation and part of ZTP role

noredistribution commented 4 years ago

awesome! thanks @titom73