SUMMARY
I tried to use this module to automate BGP configuration but it doesn't work with Vyos 1.4.x due to invalid syntax of configuration commands this module tries to send.
COMPONENT NAME
vyos.vyos.vyos_bgp_address_family vyos.vyos.vyos_bgp_global
ANSIBLE VERSION
ansible 2.10.8
COLLECTION VERSION
vyos.vyos 4.1.0
CONFIGURATION
ansible-config dump --only-changeded CONFIG_FILE() = None
OS / ENVIRONMENT
ubuntu ansible==10.0.1 ansible-core==2.17.0 ansible-pylibssh==1.1.0 bcrypt==4.1.3 cffi==1.16.0 cryptography==42.0.8 Jinja2==3.1.4 jmespath==1.0.1 MarkupSafe==2.1.5 packaging==24.0 paramiko==3.4.0 pycparser==2.22 PyNaCl==1.5.0 PyYAML==6.0.1 resolvelib==1.0.1
STEPS TO REPRODUCE
Run a playbook from module examples
- name: configure bgp vyos.vyos.vyos_bgp_address_family: config: as_number: "100" address_family: - afi: "ipv4" redistribute: - protocol: "static" metric: 50 neighbors: - neighbor_address: "20.33.1.1/24" address_family: - afi: "ipv4" allowas_in: 4 as_override: True attribute_unchanged: med: True - afi: "ipv6" default_originate: "map01" distribute_list: - action: "export" acl: 10 - neighbor_address: "100.11.34.12" address_family: - afi: "ipv4" maximum_prefix: 45 nexthop_self: True route_map: - action: "export" route_map: "map01" - action: "import" route_map: "map01" weight: 50
EXPECTED RESULTS
BGP is configured on Vyos router
ACTUAL RESULTS
Getting syntax error message. I guess there was a change in Vyos BGP configuration command structure.
TASK [configure bgp] ****************************************************************************************************************************************** fatal: [vyos_router]: FAILED! => {"changed": false, "module_stderr": "set protocols bgp 100 address-family ipv4-unicast redistribute static metric 50\r\n\r\n Configuration path: protocols bgp [100] is not valid\r\n Set failed\r\n\r\n[edit]\r\r\nvyos@vyos# ", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"}
working commands should be:
set protocols bgp system-as '100' set protocols bgp address-family ipv4-unicast redistribute static metric '50'