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
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024