Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loopback_ipv4_address under node: not resolve the variable input #4370

Open
1 task done
jixh99 opened this issue Aug 16, 2024 · 2 comments
Open
1 task done

loopback_ipv4_address under node: not resolve the variable input #4370

jixh99 opened this issue Aug 16, 2024 · 2 comments
Labels
type: bug Something isn't working

Comments

@jixh99
Copy link

jixh99 commented Aug 16, 2024

Issue Summary

The dict key "loopback_ipv4_address" not resolve the inputs as variable, while other keys do, like "mgmt_ip" and "bgp_as".

the AVD inputs:

l3leaf:
defaults:
platform: cEOS
loopback_ipv4_pool: "{{ NETv4_LPBK_ULAY }}"
loopback_ipv4_offset: 0
...
nodes:
- name: cleaf01
id: 1
loopback_ipv4_address: "{{ NETv4_LPBK_ULAY | ansible.utils.ipaddr(2) | ansible.utils.ipaddr(address) }}"
mgmt_ip: "{{NETv4_MGMTA | ansible.utils.ipaddr(seq_id) }}"
bgp_as: "{{ bgp_asn_base + dc_id*100 + seq_id }}"

Generate CFG

interface Loopback0
description EVPN_Overlay_Peering
no shutdown
ip address {{ NETv4_LPBK_ULAY | ansible.utils.ipaddr(2) | ansible.utils.ipaddr(address) }}/32
!

Which component(s) of AVD impacted

eos_cli_config_gen

How do you run AVD ?

Ansible CLI (with virtual-env or native python)

Steps to reproduce

# L3 Leaf switch group
l3leaf:
  defaults:
    platform: cEOS
    loopback_ipv4_pool: "{{ NETv4_LPBK_ULAY }}"
    loopback_ipv4_offset: 0
    vtep_loopback_ipv4_pool: "{{ NETv4_LPBK_OLAY }}"
    uplink_switches: ['spine01', 'spine02']
    uplink_ipv4_pool: "{{ NETv4_PTP }}"
    virtual_router_mac_address: 00:1c:73:{{'%02d' % rack_id}}:{{'%02d' % rack_id}}:99
    spanning_tree_priority: 4096
    spanning_tree_mode: mstp

  nodes:
    - name: cleaf01
      id: 1
      loopback_ipv4_address: "{{ NETv4_LPBK_ULAY | ansible.utils.ipaddr(2) | ansible.utils.ipaddr(address) }}"
      mgmt_ip: "{{NETv4_MGMTA | ansible.utils.ipaddr(seq_id) }}"
      bgp_as: "{{ bgp_asn_base + dc_id*100 + seq_id }}"
      uplink_switch_interfaces:
        - Ethernet1
        - Ethernet1

Relevant log output

interface Loopback0
   description EVPN_Overlay_Peering
   no shutdown
   ip address {{ NETv4_LPBK_ULAY | ansible.utils.ipaddr(2) | ansible.utils.ipaddr(address) }}/32
!

Contributing Guide

  • I agree to follow this project's Code of Conduct
@jixh99 jixh99 added the type: bug Something isn't working label Aug 16, 2024
@ClausHolbechArista
Copy link
Contributor

ClausHolbechArista commented Aug 20, 2024

My guess is that address needs to be enclosed in single quotes to be picked up as a string instead of an undefined variable.
Unfortunately Ansible stops templating of vars (silently) if any errors are hit.

@ClausHolbechArista
Copy link
Contributor

ClausHolbechArista commented Aug 20, 2024

Recreating the issue with https://ansible.sivel.net/test/:
image

Working example:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants