You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HI @pffs,
looking at the structure of the playbook there is no need for the config lines to be termed under parent, as the config module tries to push the same config considering each parent at once. That is the intended behavior of the module.
The following playbook should work in your case,
Unless I'm grossly misunderstanding how this module works, that doesn't seem to be accurate.
These are multiple nested config elements that would look like:
policy-map Foo
class COS1
police rate percent 4
conform-action transmit
exceed-action drop
Using your example would scope those lines to the root of the config which would result in them always running as the rest lines after the first one will never be in the root of the config.
So yes, technically your example will work, but it's not idempotent and doesn't seem the intended use of the module. It also doesn't follow the documentation for the module which lists parents as "The ordered set of parents that uniquely identify the section or hierarchy the commands should be checked against."
SUMMARY
When using replace: block with
ios_config
with multiple layers of parents, the lines are re-applied for every level of parent.ISSUE TYPE
COMPONENT NAME
ios_config
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Controller is Ubuntu 18.04, devices are various Cisco IOS routers and switches.
STEPS TO REPRODUCE
ios_config task with multiple parents and replace: block
EXPECTED RESULTS
Should only apply the following lines:
ACTUAL RESULTS
Notice that the two lines from the lines attribute are ultimately applied 3 times. Verified on the router itself that this actually happening.
The text was updated successfully, but these errors were encountered: