Is it possible to list the tasks in an Ansible role?
i.e. other than just grepping for - name
, is there an out-of-the-box way of doing this?
Is it possible to list the tasks in an Ansible role?
i.e. other than just grepping for - name
, is there an out-of-the-box way of doing this?
Create a simple playbook specifying the role and execute ansible-playbook
with --list-tasks
option.
But this will not list the tasks in dynamically included files.
You need to identify the play to display. ex:
ansible-playbook --list-tasks my-play.yml
And tasks in roles imported with include_role will not be displayed. As @techraf said, this is dynamically loaded.