List Ansible playbook tasks and tags
Build a paste-ready command, then review its compatibility and effects before running it.
ansible-playbook -i <inventory> playbook.yml --list-tasks --list-tagsComplete required fields to copy the generated command.
read-onlyno known side effects Compatibility
LinuxVerified for Linux using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-20
Requirementsansible-playbookansible-playbook must be installed and available on PATH.
Version supportansible-playbook Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsplaybook: playbook.ymlRepresentative 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 {{inventory}} playbook.yml --list-tasks --list-tagsThe 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>ParameterA value supplied in the Fill parameters section.
04playbook.ymlArgumentPasses playbook.yml to ansible-playbook.
05--list-tasksOptionConfigures ansible-playbook with the --list-tasks option.
06--list-tagsOptionConfigures ansible-playbook with the --list-tags option.
Example input
ansible-playbook -i inventory.ini playbook.yml --list-tasks --list-tags
Example output
playbook: playbook.yml
play #1 (web): Configure web servers TAGS: []
tasks:
Install nginx TAGS: [packages]
Deploy config TAGS: [config]
Illustrative output — exact values vary by system and data.
Official sources