- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
09-05-2022 08:54 AM
hi ,
i'm trying to create static route with next hop type as a "next-vr" , and as a interface "None" in ansible. but seems like i'm getting an error for nexthop and interface...
sample playbook:
- name: Create route to aws tunnel-1
panos_static_route:
provider: '{{ provider }}'
name: "Route {{ item.id }} to {{ vendor_name }}"
destination: '{{ item.vpc_net }}'
interface: 'None'
nexthop: 'next-vr'
nexthop_type: 'none'
virtual_router: 'SR1'
getting below error:
{"ansible_loop_var": "item", "changed": false, "item": {"id": 1, "vpc_net": "20.0.0.0/24"}, "msg": "Failed create: Route 1 to ansible-test -> interface 'None' is not a valid reference\n Route 1 to ansible-test -> interface is invalid"}
here is the original module for panos_static_route on ansible docx...
https://ansible-pan.readthedocs.io/en/latest/modules/panos_static_route_module.html
can you please let me know what i'm misisng here, it works absolutely fine with GUI...
thanks...!!
09-05-2022 09:29 AM - edited 09-05-2022 09:31 AM
Hi @Bhargav_2784,
Per the docs (by the way, for your bookmarks, the current docs are https://paloaltonetworks.github.io/pan-os-ansible not https://ansible-pan.readthedocs.io) you only have to make a couple of changes:
An example from your code:
- name: Create route to aws tunnel-1
panos_static_route:
provider: '{{ provider }}'
name: "Route {{ item.id }} to {{ vendor_name }}"
destination: '{{ item.vpc_net }}'
#interface: 'None'
nexthop: '{{ your-next-vr }}'
nexthop_type: 'next-vr'
virtual_router: '{{ the-vr-requiring-the-route }}'
Hope this helps!
09-05-2022 09:29 AM - edited 09-05-2022 09:31 AM
Hi @Bhargav_2784,
Per the docs (by the way, for your bookmarks, the current docs are https://paloaltonetworks.github.io/pan-os-ansible not https://ansible-pan.readthedocs.io) you only have to make a couple of changes:
An example from your code:
- name: Create route to aws tunnel-1
panos_static_route:
provider: '{{ provider }}'
name: "Route {{ item.id }} to {{ vendor_name }}"
destination: '{{ item.vpc_net }}'
#interface: 'None'
nexthop: '{{ your-next-vr }}'
nexthop_type: 'next-vr'
virtual_router: '{{ the-vr-requiring-the-route }}'
Hope this helps!
09-11-2022 06:59 PM
thanks @JimmyHolland , that works...
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!