On Mon, 9 Mar 2020 06:06:39 -0700 (PDT)
Sanjay <[email protected]> wrote:

> Any idea/comments why this doesn't work?
> Installed aversion -  2.9.0
> 
> Playbook : test.yml
> --
>   - name: substitute vars
>     hosts: localhost
>     gather_facts: False
>     vars_files:
>       - "vars.yml"
>     tasks:
>       - name: print vars
>         debug: msg="{{ vars.a }}"
> 
> vars.yml
> a: "{{ lookup('env', 'HOME') }}"
> 
> Output : 
> TASK [print vars] 
> ok: [localhost] => {
>     "msg": "{{ lookup('env', 'HOME') }}"
> }
> 
> Why it doesn't print the HOME env value?

There is no reason toreference "vars". Try

          debug: msg="{{ a }}"

HTH,

        -vlado

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20200309144711.1f826864%40gmail.com.

Attachment: pgpOKwVobVzMp.pgp
Description: OpenPGP digital signature

Reply via email to