aristanetworks / ansible-cvp

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

Fix(dhcp_configuration) Per dhcp client registration setting not working #606

Closed kmueller68 closed 1 year ago

kmueller68 commented 1 year ago

Change Summary

This fixes the behaviour that the dhcp bootfile-name option is now also rendered on a per client basis instead of only global. Futher it aligns to the AVD documentation now.

Related Issue(s)

Fixes #605

Component(s) name

arista.cvp.dhcp_configuration

Proposed changes

dhcp.conf.j2 is adjusted: old: option bootfile-name "{{ ztp.default.registration }}";

new:

{%     if client.registration is defined %}
    option bootfile-name "{{ client.registration }}";
{%     elif ztp.default.registration is defined %}
    option bootfile-name "{{ ztp.default.registration }}";
{%     endif %}

How to test

Use the key registrationper dhcp client:

---
ztp:
  default:
    registration: 'http://10.0.110.12/ztp/bootstrap'
    nameservers:
      - '10.0.0.21'
  general:
    subnets:
      - network: 10.0.110.0
        netmask: 255.255.255.0
        gateway: 10.0.110.1
        nameservers:
          - '10.0.0.21'
        start: 10.0.110.240
        end: 10.0.110.254
        lease_time: 300
    - name: KHM-SW-SPINE-101
      mac: '50:DE:01:02:00:00'
      ip4: 10.0.110.10
      registration: 'http://10.0.110.17/ztp/bootstrap'
      gateway: 10.0.110.1

Checklist

User Checklist

Repository Checklist

github-actions[bot] commented 1 year ago

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 15 days