aristanetworks / ansible-cvp

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

Bug(dhcp_configuration): registration key is not rendered if set per client #605

Open kmueller68 opened 1 year ago

kmueller68 commented 1 year ago

Issue Summary

/cvp/roles/dhcp_configuration/

registration should be accepted per client according to the doc, but it is not rendered.

  clients:            < List of clients on a mac-address basis >
    - name:           < * Hostname to provide when device do a DHCP request >
      mac:            < * Mac address of the host. Mac address value MUST be protected by either single or dual quotes >
      ip4:            < * IP Address of the host >
      registration:   < Registration URL to use for the host. If not set, default value will be applied >

The J2 code is:

    option bootfile-name "{{ ztp.default.registration }}";

but should be

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

Which component(s) of AVD impacted

other

How do you run AVD ?

Ansible CLI (with virtual-env or native python)

Input variables

---
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

Steps to reproduce

No response

Relevant log output

config of dhcpd.conf should look like:

host KHM-SW-SPINE-101 {
    option host-name "KHM-SW-SPINE-101";
    hardware ethernet 50:DE:01:02:00:00;
    fixed-address 10.0.118.10;
    option bootfile-name "http://10.0.110.17/ztp/bootstrap";
    option routers 10.0.118.1;
    option domain-name-servers 10.0.0.21;

Code of Conduct

kmueller68 commented 1 year ago

@sugetha24 What’s the timeline for v4.0.0?

Could I open a pull request for the fix?

sugetha24 commented 1 year ago

@sugetha24 What’s the timeline for v4.0.0?

Could I open a pull request for the fix?

It's currently set for June, but it's tentative. Do note that the DHCP role is slated to be deprecated from arista.cvp and is potentially moving to another collection. In the meantime, please go ahead and file a PR for this.

github-actions[bot] commented 1 year ago

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

kmueller68 commented 1 year ago

@sugetha24 How could we proceed on this?

github-actions[bot] commented 1 year ago

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

kmueller68 commented 6 months ago

@sugetha24 is there still a change to get this fixed?