-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hashivault_init does not return the generated keys in result #35
Comments
Here is the working functional test if that helps: https://github.com/TerryHowe/ansible-modules-hashivault/blob/master/functional/test_init.yml The only odd thing I notice is you register vault_init, but have some environment variable of the same name and I assume that is what gets printed. |
Many thanks Terry, totally my mistake. |
I think your dual use of the vault_init variable is causing a misleading
result from your debug task.
Suggest using some other variable (key) for 'register:' in your
hashivault_init task, then use that new variable as the input to debug
task.
On Oct 25, 2017 12:56 PM, "Thales Ceolin" <notifications@github.com> wrote:
- hashivault_init:
register: 'vault_init'
environment:
VAULT_ADDR: "{{ VAULT_ADDR }}"
when: vault_init
run_once: yes
- debug: msg="{{vault_init}}"
The debug returns:
TASK [platform-vault-init : debug]
******************************************************************
ok: [10.0.20.143] => {
"msg": true
}
It's missing the keys.
This seems to be not working: https://github.com/TerryHowe/
ansible-modules-hashivault/blob/master/ansible/modules/
hashivault/hashivault_init.py#L101
Any ideas?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#35>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AKvcXqNhVZBqFKvDm_TxeceaVGuED8RIks5sv4RxgaJpZM4QGfY0>
.
|
Many thanks @dizzler . That was the issue. Another thing I just came across: I'm trying to re-use the newly generated keys to unseal the vault just after the init:
This doesn't work. If you have any ideas on that would be great. |
Replying my own question, I came up with this:
In the future might me nice to generate this automatically. Thanks all of you. |
This is how the function tests do it although your solution is fewer lines https://github.com/TerryHowe/ansible-modules-hashivault/blob/master/functional/test_init.yml#L17-L21 |
I guess one other thing, you should be able to specify VAULT_ADDR as an argument rather than the environment if you like
I didn't test that, but it should work |
The debug returns:
It's missing the keys.
This seems to be the culprit: https://github.com/TerryHowe/ansible-modules-hashivault/blob/master/ansible/modules/hashivault/hashivault_init.py#L101
Any ideas?
The text was updated successfully, but these errors were encountered: