Closed AndrewSav closed 4 years ago
My guess why it failed would be that the content of the secret I'm trying to read is not base64 encoded. If that's the reason I suggest the following changes:
Well, that is a particularly odd module because it uses the copy module.
When I run with -v
I get a message that says to use -vvv
for full stack trace and it does work with -vvv
:
The full traceback is:
Traceback (most recent call last):
File "/home/terry/.venvs/hashivault/lib/python3.6/site-packages/ansible/executor/task_executor.py", line 146, in run
res = self._execute()
File "/home/terry/.venvs/hashivault/lib/python3.6/site-packages/ansible/executor/task_executor.py", line 645, in _execute
result = self._handler.run(task_vars=variables)
File "/home/terry/.venvs/hashivault/lib/python3.6/site-packages/ansible/plugins/action/hashivault_read_to_file.py", line 74, in run
local_tmp.write(base64.b64decode(content))
File "/home/terry/.venvs/hashivault/lib/python3.6/base64.py", line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
I'm not sure where this message about -vvv
comes from. I run it under awx and there is no such message. Having said that, it is possible to increase the log level in awx, it's just not obvious thing to do.
I haven't messed with awx, but I've noticed with Tavis for example, I don't get all the messages I get when I run in a terminal session. I assume somewhere someone isn't routing stderr and it just gets lost.
Running this in awx:
Getting this:
Same secret / key works with
hashivault_read
. I was not able to get anything butMODULE FAILURE
with empty output out ofhashivault_read_to_file