View fully-resolved value of variable

Viewed 23

I'm learning Ansible and want to know how to view the fully resolved value of a variable in my playbook. For example:

---
- name: A contrived example
  hosts: localhost
  vars:
    first_name: Mary
    last_name: Elizabeth
    full_name: "{{first_name}} {{last_name}}"
  tasks:
    - name: Print full name
      debug:
        msg: Hello {{ full_name }}
      debugger: always

When stopped in the debugger, I can print the value of full_name:

(debug)> task_vars["full_name"]
'{{first_name}} {{last_name}}'  # unresolved!

How can I resolve it to show Mary Elizabeth?

0 Answers
Related