03-23-2018 12:43 PM - edited 03-08-2019 02:22 PM
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.
Solved! Go to Solution.
03-23-2018 03:20 PM
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']
03-23-2018 03:20 PM
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']
03-24-2018 08:41 AM
Can you explain the Parents syntax, just I can understand when to use it?
03-24-2018 10:39 AM
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
03-26-2018 08:10 AM
Should I do the same for the interfaces. My loopback code does not have that but works.
03-26-2018 08:43 AM
Interfaces don't need the parent.
Have you tried the OSPF with the 'parent' ? Does it work ?
03-26-2018 08:55 AM
Yes it did work. I just had that one question before I select your answer.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide