I have this playbook:
---
- hosts: localhost
roles:
- { role: webserver, tags: ['webserver'], app_role: 'webserver' }
- { role: dbserver, tags: ['dbserver'], app_role: 'dbserver' }
The two roles have a task with a "name" that has "{{ app_role }}" in it. E.g.:
$ cat roles/webserver/tasks/main.yml
---
- name: "Show this is the {{ app_role }} role"
debug: msg="This is the webserver role"
If I execute the playbook normally, ansible shows the task names with the variable substituted in, which is great:
TASK: [webserver | Show this is the webserver role]
TASK: [dbserver | Show this is the dbserver role]
But with --list-tasks, it doesn't do the variable substitution:
$ ansible-playbook role_tags.yml --tags=dbserver,webserver --list-tasks
playbook: role_tags.yml
play #1 (localhost):
Show this is the {{ app_role }} role
Show this is the {{ app_role }} role
Is it possible to get ansible to display the name with the variable substitutions applied when running with --list-tasks?
Thanks!
Marc