On 16. sep. 2016 20:50, ZillaYT wrote:
From How to set environment variable with value obtained from
<https://groups.google.com/forum/#!topic/ansible-project/KCpkbncyOxI> I'm
using lookup to get the values from a file off my home directory. But how
do I nest the result of one lookup call into a subsequent lookup call? In
the following code, I want to use the value of home_dir in the subsequent

- name: Set AWS variables
    home_dir: lookup('env', 'HOME')
    aws_access_key_id: "{{ lookup('ini', 'aws_access_key_id section=default 
file=home_dir/.aws/credentials') }}"
    aws_secret_access_key: "{{ lookup('ini', 'aws_secret_access_key section=default 
file=home_dir/.aws/credentials') }}"

If you use file=~/.aws/credentials it will work.

Kai Stian Olstad

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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to