cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3591
Views
0
Helpful
6
Replies

Ansible and OSPF

Joshuabowers
Level 1
Level 1

I'm trying to configure Ansible to configure OSPF on a lab router.

So far I can get Ansible to create a Loopback0, but keeps failing on the ospf config. 

I'm new to this, so I'm not sure if I'm using the correct model for a cisco 3800 router.

1 Accepted Solution

Accepted Solutions

Hello,

 

I think you have to use the syntax below ('parents'):

 

- name: IOS | Configure OSPF
ios_config:
provider: "{{ provider }}"
lines:
- network 10.55.55.0 0.0.0.255 area 0
parents: ['router ospf 1']

View solution in original post

6 Replies 6

Hello,

 

I think you have to use the syntax below ('parents'):

 

- name: IOS | Configure OSPF
ios_config:
provider: "{{ provider }}"
lines:
- network 10.55.55.0 0.0.0.255 area 0
parents: ['router ospf 1']

Can you explain the Parents syntax, just I can understand when to use it?

Hello,

 

the 'parent' syntax simply means that there is a hierarchy in the commands. In this case, 'router ospf 1' goes first, the networks are then added. In IOS it is:

 

R3(config)#router ospf 1 <-- Parent Leve;
R3(config-router)#network 10.55.55.0 0.0.0.255 area 0 <--Sub Level

Should I do the same for the interfaces. My loopback code does not have that but works.

Interfaces don't need the parent.

 

Have you tried the OSPF with the 'parent' ? Does it work ?

Yes it did work. I just had that one question before I select your answer.

Review Cisco Networking for a $25 gift card