Idempotent

According to Wikipedia, Idempotence is the property of certain operations in mathematics and computer science that can be applied multiple times without changing the result beyond the initial application (https://en.wikipedia.org/wiki/Idempotence). In more common terms, it means running the same procedure over and over again does not change the system after the first time. Ansible aims to be idempotent, which is good for network operations that require certain order of operations.

The advantage of idempotence is best compared to the Pexpect and Paramiko scripts that we have written. Remember that these scripts were written to push out commands as if an engineer is sitting at the terminal. If you were to execute the script 10 times, there will be 10 times that the script makes changes. The Pexpect and Paramiko approach, compare to Ansible playbook that accomplishes the same change, the existing device configuration will be checked first, and the playbook will only execute if the changes does not exist.

Being idempotent means we can repeatedly execute the playbook without worrying that there will be unnecessary changes being made. This would be important as we need to automatically check for state consistency without any extra overhead.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.20.68