Ansible Tutorials: Ansible Workflow

Ansible Check Mode

Ansible Check Mode: When you run an Ansible playbook or command in check mode, it’s also known as “dry-run” mode. In this mode, Ansible performs a simulation of the tasks specified in the playbook without making any actual changes to the target systems. This allows you to preview what changes would be made if the playbook were run normally.

To run Ansible in check mode, you use the --check or -C flag with the ansible-playbook command or any other Ansible command. For example:

This is useful to verify the impact of a playbook before applying changes to production systems. It helps prevent unintended consequences.

ansible-playbook my_playbook.yml --check

Ansible Run Mode:

Ansible run mode refers to the standard way of executing Ansible playbooks or commands, where tasks specified in the playbook are executed against the target systems. When you run a playbook without the --check flag, Ansible applies the defined tasks to the target hosts, bringing their state in line with what’s specified in the playbook.

This mode is used to apply actual changes, configurations, installations, and other tasks to the target systems based on the playbook’s instructions.

ansible-playbook my_playbook.yml
Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x