cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1330
Views
5
Helpful
1
Replies

Ansible and ignore if change is not required

romanroma
Level 1
Level 1

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

 

1 Reply 1

Seb Rupik
VIP Alumni
VIP Alumni

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.