Sorry for chiming in this late, but I think there is still an error in the logic.
Using this playbook:
---
- hosts: tags_isp1
connection: ansible.netcommon.network_cli
gather_facts: false
vars:
ansible_user: vyos
ansible_network_os: vyos.vyos.vyos
tasks:
- name: Set nex-hop
vyos.vyos.vyos_static_routes:
config:
- address_families:
- afi: ipv6
routes:
- dest: '2001:aaaa:bbbb:cccc::/56'
next_hops:
- forward_router_address: 'fe80::be24:11ff:fe3f:af6'
interface: 'eth2'
state: rendered
register: output
- name: Display output
debug:
msg: "{{ output }}"
When I use state: rendered it works correctly:
ok: [p1r4v] => {
"msg": {
"changed": false,
"failed": false,
"rendered": [
"set protocols static route6 2001:aaaa:bbbb:cccc::/56",
"set protocols static route6 2001:aaaa:bbbb:cccc::/56 next-hop 'fe80::be24:11ff:fe3f:af6'",
"set protocols static route6 2001:aaaa:bbbb:cccc::/56 interface 'eth2'"
]
}
}
but when using state:replaced it fails:
[ERROR]: Task failed: Action failed: 'forward_router_address'
Origin: /home/aibix/projects/ansible-playbooks/playbooks/routes-test.yml:9:7
7 ansible_network_os: vyos.vyos.vyos
8 tasks:
9 - name: Set nex-hop
^ column 7
fatal: [p1r4v]: FAILED! => {"changed": false, "msg": "'forward_router_address'"}
The CLI is accepting the config:
vyos@p1r4v:~$ show conf comm | match route6
set protocols static route6 2001:aaaa:bbbb:cccc::/56 next-hop fe80::be24:11ff:fe3f:af6 interface 'eth2'
As it should be (one needs an interface when next-hop is a link-local).
What am I missing? Can this be fixed?
Originally posted by @aibix0001 in #398 (comment)
Sorry for chiming in this late, but I think there is still an error in the logic.
Using this playbook:
When I use state: rendered it works correctly:
but when using state:replaced it fails:
The CLI is accepting the config:
As it should be (one needs an interface when next-hop is a link-local).
What am I missing? Can this be fixed?
Originally posted by @aibix0001 in #398 (comment)