From the course: Ansible: From Basics to Guru by Pearson

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Using Ansible in an idempotent way

Using Ansible in an idempotent way - Ansible Tutorial

From the course: Ansible: From Basics to Guru by Pearson

Using Ansible in an idempotent way

In this video, I'll tell you about using Ansible in an idempotent way. So what is idempotency? Idempotency means that regardless the state of the managed machine, running the same module should always lead to the same results. So there are two options. Either your managed machine is already in the desired state and then nothing has to happen or your managed machine is not yet in the desired state and then a change needs to be applied. And that's what idempotency needs to guarantee. Idempotency is very important and most Ansible modules were developed with idempotency in mind. But they are not all idempotent and that's important to realize. Generic modules like command and shell and roll for instance are not idempotent. And why is that so important? Well, it's important because if you don't develop Ansible content for idempotency, you will get failures. And if an Ansible module fails, then further execution on that specific host will stop. That is not important if you are running a…

Contents