Digital Marketing

Ansible Dry Run

When ansible-playbook is executed with --check it will not make any changes on remote systems. 

Example:
ansible --connection=local   -m ping localhost --check
localhost | SUCCESS => {
    "changed": false,
    "ping": "pong"
}

Sometimes you may want to modify the check mode behavior of individual tasks. This is done via the check_mode option, which can be added to tasks.

There are two options:

  1. Force a task to run in check mode, even when the playbook is called without --check. This is called check_mode: yes.
  2. Force a task to run in normal mode and make changes to the system, even when the playbook is called with --check. This is called check_mode: no.

Comments

Popular posts from this blog

MySQL Sandbox with the Sakila sample database