Given the following Ansible playbook snippet: --- - name: Configure OSPF hosts: routers gather_facts: no tasks: - name: OSPF config ios_config: lines: - router ospf 1 - network 10.0.0.0 0.255.255.255 area 0 parents: router ospf 1 What is wrong with this playbook?
Correct. The 'parents' parameter already enters the mode, so the 'router ospf 1' line inside lines is redundant and causes an error.
Why this answer
The playbook attempts to enter OSPF router configuration mode by using 'parents: router ospf 1', but the 'lines' also include 'router ospf 1' which would try to enter the mode again from within the mode, causing an error. The correct approach is to either use 'parents' or include the router command in 'lines', but not both.