Ansible and ignore if change is not required
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2021 10:55 AM
So I am building a simple playbook that will add another snmp server; however, I noticed that my playbook runs even if the command is already installed on the switch.
I am using the 'cisco.ios.ios_config' module and the playbook is successfully adding the new snmp server; however, switches that already have this server installed, the playbook does not ignore the change, and appears to still run, since the output shows logs a change.
How do I get the playbook to ignore the change it it is not required on the switch.
thank you
- Labels:
-
Network Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2021 02:13 AM
Hi there,
Have you tried adding the replace: line option to the cisco.ios.ios_config command block?
This should only push commands which are not present on the switch.
cheers,
Seb.
