Skip to content

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

Open
@kmueller68

Description

@kmueller68

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

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions