Giter Site home page Giter Site logo

Comments (7)

TerryHowe avatar TerryHowe commented on July 28, 2024

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.

from ansible-modules-hashivault.

thalesac avatar thalesac commented on July 28, 2024

Many thanks Terry, totally my mistake.
I hurried up to open the issue.
My apologies, you can close this ticket.
Also, Many thanks for your work on this module.

from ansible-modules-hashivault.

dizzler avatar dizzler commented on July 28, 2024

from ansible-modules-hashivault.

thalesac avatar thalesac commented on July 28, 2024

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:

- hashivault_unseal:
    keys: '{{ vault_init_keys.keys_base64 }}'
  environment:
    VAULT_ADDR: "{{ VAULT_ADDR }}"
  when: vault_init_keys

This doesn't work.
As far as I could see, the VAULT_KEYS expect a space separated keys and the vault_init_keys is an array.

If you have any ideas on that would be great.

from ansible-modules-hashivault.

thalesac avatar thalesac commented on July 28, 2024

Replying my own question, I came up with this:

- hashivault_unseal:
    keys: '{{ vault_init_keys.keys_base64.0 }} {{ vault_init_keys.keys_base64.1 }} {{ vault_init_keys.keys_base64.2 }}'
  environment:
    VAULT_ADDR: "{{ VAULT_ADDR }}"
  when: vault_init_keys

In the future might me nice to generate this automatically.

Thanks all of you.

from ansible-modules-hashivault.

TerryHowe avatar TerryHowe commented on July 28, 2024

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

from ansible-modules-hashivault.

TerryHowe avatar TerryHowe commented on July 28, 2024

I guess one other thing, you should be able to specify VAULT_ADDR as an argument rather than the environment if you like

- hashivault_unseal:
    keys: '{{ vault_init_keys.keys_base64.0 }} {{ vault_init_keys.keys_base64.1 }} {{ vault_init_keys.keys_base64.2 }}'
    url: "{{ VAULT_ADDR }}"
  when: vault_init_keys

I didn't test that, but it should work

from ansible-modules-hashivault.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.