Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Can't pass token to Consul lookup plugin? #857

Closed
ssenaria opened this issue Aug 22, 2015 · 5 comments
Closed

Can't pass token to Consul lookup plugin? #857

ssenaria opened this issue Aug 22, 2015 · 5 comments

Comments

@ssenaria
Copy link

With ACL enable, I'm not able to query for the value of a key I'm looking up. If I disable ACL, it works fine.

Works fine:

 {{ lookup('consul_kv', item, token="mysecretoken") }}

Thinking I have the wrong paramter, I tried to force an error. However, no errors are thrown?

{{ lookup('consul_kv', item, token123="mysecretoken") }}
@abadger
Copy link
Contributor

abadger commented Sep 1, 2015

From looking at the code, I think that this would work if you do it like this:

{{ lookup('consul_kv', item, 'token=mysecretoken') }}

If so, this is a different module but the same idea as:
ansible/ansible-modules-core#1968

Could you test if that works?

@ssenaria
Copy link
Author

ssenaria commented Sep 2, 2015

fatal: [127.0.0.1] => Failed to template deploy_list="{{ item | replace("deploylist/REL-134/",'') }}-{{ lookup('consul_kv', item, 'token=f45cbd0b-5022-47ab-8640-4eaa7c1f40f1') }}": 

Unexpected error in during lookup: run() got multiple values for keyword argument 'inject'

@abadger
Copy link
Contributor

abadger commented Sep 3, 2015

Oh... You're on 1.9.2? Try this:

{{ lookup('consul_kv', item + ' token=mysecretoken') }}

Sorry, I've been working on devel nonstop for a few weeks and so I forgot that anyone might be running releases ;-)

@abadger
Copy link
Contributor

abadger commented Sep 4, 2015

@ssenaria Did that work?

@ssenaria
Copy link
Author

ssenaria commented Sep 5, 2015

YES! That did it. Thanks a lot!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants