From the course: Ansible for Automation Essential Training: Advanced Playbooks, Roles, and Diverse Hosts
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
Testing plays with check mode - Ansible Tutorial
From the course: Ansible for Automation Essential Training: Advanced Playbooks, Roles, and Diverse Hosts
Testing plays with check mode
- [Instructor] Ansible has two execution modes. Run and check. Run mode is what is typically used and what I've used thus far. Check mode, however, will simulate automation changes rather than actually making changes. This gives an admin the ability to see what would be changed if a playbook is ran. This is good for checking if a system requires changes or perhaps to ensure that a system hasn't been changed outside of a change window. Check mode can be enabled per task or for an entire play. It's most common by far to run check mode at the play level. Ansible also has the ability to selectively choose tasks to turn check mode on for, and conversely, you can selectively choose tasks to turn check mode off of. Check mode is most commonly run at execution time via command line parameter like so, ansible-playbook dash i inventory, run the tags playbook and dash dash check. It completed successfully, but that's not very exciting. Everything just said OK. I'll edit the Nginx config file…
Contents
-
-
-
(Locked)
Installing collections2m 20s
-
Construct a simple playbook4m 19s
-
(Locked)
Using variables5m 7s
-
(Locked)
Using loops2m 45s
-
(Locked)
Adding conditionals4m 57s
-
(Locked)
Utilizing blocks3m 49s
-
(Locked)
Exploring templates4m 29s
-
(Locked)
Discovering handlers2m 23s
-
(Locked)
Using tags2m 53s
-
(Locked)
Testing plays with check mode2m 15s
-
(Locked)
Conditional failure with assert2m 20s
-
(Locked)
Failure and change control2m 32s
-
(Locked)
Nesting loops3m 29s
-
(Locked)
Creating dynamic inventory files3m 7s
-
(Locked)
Challenge: Create a complex playbook1m 17s
-
Solution: Verify the complex playbook2m 52s
-
(Locked)
-
-
-
-