cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1404
Views
0
Helpful
1
Replies

Ansible Automation for configuring OSPF on router

ShishirDash5204
Level 1
Level 1

I am trying to configure the ospf on the router in CML lab through ansible. Snippet of my playbook and host_var is attached:

this is the result that i am getting

 

TASK [Configuring OSPF on Routers] *******************************************************************************************************************
changed: [10.10.20.200] => (item={'address': '192.168.0.0', 'mask': '0.0.0.255', 'area': 0})
changed: [10.10.20.201] => (item={'address': '192.168.0.0', 'mask': '0.0.0.255', 'area': 0})
changed: [10.10.20.201] => (item={'address': '192.168.0.0', 'mask': '0.0.0.255', 'area': 0})
changed: [10.10.20.200] => (item={'address': '192.168.1.0', 'mask': '0.0.0.255', 'area': 0})

PLAY RECAP *******************************************************************************************************************************************
10.10.20.200 : ok=5 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
10.10.20.201 : ok=4 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

 

But when i am running the sh run command on the router , i can see that the network is not advertised

!
router ospf 1
area 0 capability default-exclusion
area 0 authentication
!

What is the error here? I am not able to figure out.

1 Reply 1

kkhlebop
Cisco Employee
Cisco Employee

Might be the syntax, I am not positive on it though.
In the playbook your variables have varying spaces. The documentation I looked up for ansible/jinja2 variable all have them be of the form: double curly braces with a single space in the closing and a single space in the opening side.

{{var }} or {{ var}} or {{var}} should be {{ var }}
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: