0

I have included a variable from a different Ansible .yml file. How do I print that variable to STDOUT in my playbook?

Here is an example playbook to show what I am trying to achieve:

---
- hosts: host1
  var_files: configure.yml

tasks: 
  - name: Print to stdout
    action: {{build}}.stdout

build is the variable which is included from another yml file

1 Answer 1

1

You probably want the debug module, add this as a "task":

  - debug: var={{build}}.stdout

I'm wondering whether braces are needed you've shown them, but I can't tell without more context. If this doesn't give what you expect, try without the braces. Try without the .stdout as well, the information shown can be quite educational.

1
  • braces aren't needed. Oct 18, 2015 at 13:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .