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.

Lesson 8 lab: Using when to create idempotency

Lesson 8 lab: Using when to create idempotency - Ansible Tutorial

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

Lesson 8 lab: Using when to create idempotency

Alright, we're at the end of this lesson, let's do a lab. In this lab you are going to use WAN to create idempotency. So idempotency is very nice in Ansible and it ensures that running a playbook always gives the same result, no matter the current state of the managed asset. And you have previously learned that the command module as well as related modules like shell and roll are not idempotent by nature. But if you are using Register in a smart way, you can use even these modules in an idempotent way. And in this lab, write a playbook that creates a user using the command module in such a way that the playbook is idempotent. All right, let's give it a try.

Contents