PaloAltoNetworks/pan-os-ansible

panos_dhcp_relay_ipv6_address - DHCPv6 enable and multiple IPv6 addresses

ozver3 opened this issue · 1 comments

ozver3 commented

Describe the bug 1

There seems to be two bugs that I am encountering with this module. The first one is related to enabling DHCPv6 relay. When I run a valid task, the DHCPv6 relay address gets inputed fine. However, the enable doesn't get checked. Looking at the XML, there is no yes.

Here is the task configuration:

    - name: Configure DHCPv6 Relay Servers
      panos_dhcp_relay_ipv6_address:
        provider: '{{ provider }}'
        interface: 'ae1.{{ vlan }}'
        dhcp_interface: 'ae1.{{ vlan }}'
        dhcp_relay_interface: 'ae1.{{ vlan }}'
        ipv6_address: 'xxxx:xxxx:xxxx:xxx::xxxx:xxxx'

Expected behavior

      <dhcp>
        <interface>
          <entry name="ae1.10">
            <relay>
              <ip>
                <enabled>yes</enabled>
                <server>
                  <member>x.x.x.x/member>
                  <member>x.x.x.x</member>
                </server>
              </ip>
              <ipv6>
                <server>
                  <entry name="xxxx:xxxx:xxxx:xxx::xxxx:xxxx">
                    <interface>ae1.10</interface>
                  </entry>
                </server>
                <enabled>yes</enabled>
              </ipv6>
            </relay>
          </entry>
        </interface>
      </dhcp>

Current behavior

      <dhcp>
        <interface>
          <entry name="ae1.10">
            <relay>
              <ip>
                <enabled>yes</enabled>
                <server>
                  <member>x.x.x.x/member>
                  <member>x.x.x.x</member>
                </server>
              </ip>
              <ipv6>
                <server>
                  <entry name="xxxx:xxxx:xxxx:xxx::xxxx:xxxx">
                    <interface>ae1.10</interface>
                  </entry>
                </server>
              </ipv6>
            </relay>
          </entry>
        </interface>
      </dhcp>

Suggestion

DHCPv4 behavior is correct in that it adds the <enabled>yes</enabled>. Please add that in the DHCPv6 relay module.

Describe the bug 2

The module doesn't allow to add multiple DHCPv6 addresses unlike DHCPv4 relay module.

Here is the task:

    - name: Configure Historic Campus DHCPv6 Relay Servers
      panos_dhcp_relay_ipv6_address:
        provider: '{{ provider }}'
        interface: 'ae1.{{ vlan }}'
        dhcp_interface: 'ae1.{{ vlan }}'
        dhcp_relay_interface: 'ae1.{{ vlan }}'
        ipv6_address:
          - 'xxxx:xxxx:xxxx:xxx::xxxx:xxxx'
          - 'xxxx:xxxx:xxxx:yyy::yyyy:yyyy'

Here is the error message:

fatal: [labfw]: FAILED! => {"changed": false, "msg": "Failed create:  ipv6 -> server -> ['xxxx:xxxx:xxxx:xxx::xxxx:xxxx', 'xxxx:xxxx:xxxx:yyy::yyyy:yyyy'] ['xxxx:xxxx:xxxx:xxx::xxxx:xxxx', 'xxxx:xxxx:xxxx:yyy::yyyy:yyyy'] is an invalid ipv4/v6 address\n ipv6 -> server is invalid"}

Suggestion

Allow multiple IPv6 addresses just like DHCPv4 relay module.

Your Environment

  • PAN-OS: 10.2.3
  • Collection: 2.17.2
  • Python: 3.10.6
  • Ansible: core 2.14.6
  • PAN-OS Python Library & version (e.g. pandevice 0.14.0, pan-os-python 1.0.2): pan-python 0.17.0

🎉 Thanks for opening your first issue here! Welcome to the community!