Dry run (check mode)

Show what would change, with diffs, without changing anything

ansible-playbook site.yml --check --diff -i inventory.ini

tool
ansible56 commands
tags
ansibledebug

More ansible commands

  • ansible-playbook deploy.yml -e 'env=prod version=2.1.0' -i inventory.ini

    Override variables from the command line

  • ansible-playbook site.yml --limit 'web-01,web-02' -i inventory.ini

    Run the playbook only on the listed hosts

  • ansible-playbook site.yml --tags 'config,restart' -i inventory.ini

    Run only the tasks with these tags

  • ansible-playbook site.yml --skip-tags 'slow,optional' -i inventory.ini

    Skip tasks with these tags

  • ansible-playbook site.yml -vvv -i inventory.ini 2>&1 | tee /tmp/ansible.log

    Maximum verbosity for debugging, with a copy saved to a log file

all 56 ansible commands