Preview an Ansible playbook with check mode and diffs
Build a paste-ready command, then review its compatibility and effects before running it.
ansible-playbook -i <inventory-file> <playbook-file> --check --diff --limit <host>Complete required fields to copy the generated command.
Compatibility
Linux + macOSVerified for Linux, macOS using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsansible-playbookansible-playbook must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportansible-playbook Current supported releasesVerified for linux, macos using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsTASK [Render nginx config] ****************************************Representative successful output; values vary with the selected target and system state.
Known errorsansible-playbook: command not foundansible-playbook is missing or is not available on PATH.
Verifyansible-playbook -i {{inventoryFile}} {{playbookFile}} --check --diff --limit {{host}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01ansible-playbookCommandRuns the ansible-playbook stage of this one-liner.
02-iOptionConfigures ansible-playbook with the -i option.
03<inventory-file>ParameterA value supplied in the Fill parameters section.
04<playbook-file>ParameterA value supplied in the Fill parameters section.
05--checkOptionRuns validation or simulation mode without applying changes.
06--diffOptionShows the changes that would be made.
07--limitOptionRestricts the operation to the supplied target or maximum.
08<host>ParameterA value supplied in the Fill parameters section.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
ansible-playbook -i inventory.ini deploy.yaml --check --diff --limit web-01
Example output
TASK [Render nginx config] ****************************************
--- before: /etc/nginx/nginx.conf
+++ after: /root/.ansible/tmp/...
@@ -18 +18 @@
-worker_connections 1024;
+worker_connections 4096;
changed: [web-01]
PLAY RECAP web-01 : ok=12 changed=1 unreachable=0 failed=0
Illustrative output — exact values vary by system and data.
Official sources