Indeed, hence why it doesn't work.

Is there any other way to pass an environment variable to a lookup plugin?

The only thing I've come up with is a not very elegant:

lookup('pipe', '(export AWS_ACCESS_KEY_ID=' + assumed_role.sts_creds.access_key 
+ ' && export AWS_SECRET_ACCESS_KEY=' + assumed_role.sts_creds.secret_key + ' 
&& export AWS_SECURITY_TOKEN=' + assumed_role.sts_creds.session_token + ' 
&& credstash -r ' + aws_region + ' -t ' + env + '-credstash get 
rds_instance_mysql-1_username)')

This then fails when I am not using STS.

On Tuesday, 11 April 2017 03:07:54 UTC+10, Brian Coca wrote:
>
> The environment keyword ONLY affects remote task execution (invoked 
> inside connection), not the 'local' environment which is what lookups 
> run under. 
>
> ---------- 
> Brian Coca 
>

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dbcc7538-7668-4075-8b50-90d614998792%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to