Giter Site home page Giter Site logo

Comments (11)

wknapik avatar wknapik commented on July 28, 2024

Seems to be an issue with hvac. Reported it here hvac/hvac#183.

from ansible-modules-hashivault.

laurentribot avatar laurentribot commented on July 28, 2024

The hvac issue is closed with adding support to k/v v2 api.
Unfortunately, without autodection of the bakend version
Perhaps hashivault modules should implement a new parameter to set the api version to use
@TerryHowe

from ansible-modules-hashivault.

TerryHowe avatar TerryHowe commented on July 28, 2024

Yes. Docs https://hvac.readthedocs.io/en/latest/usage/secrets_engines/kv_v2.html

from ansible-modules-hashivault.

drewmullen avatar drewmullen commented on July 28, 2024

FYI - you can prepend your secret option in your play with data and it works fine. example:

    - name: terry howe vault read
      hashivault_read:
        secret: data/test

reads a secret at secret/test (kv2) just fine

from ansible-modules-hashivault.

drewmullen avatar drewmullen commented on July 28, 2024

I'm picking this issue up for hashivault_write, @TerryHowe whats the purpose of this function?
NVM, this wasnt as hard as i thought. PR inc

def _convert_to_seconds(original_value):
try:
value = str(original_value)
seconds = 0
if 'h' in value:
ray = value.split('h')
seconds = int(ray.pop(0)) * 3600
value = ''.join(ray)
if 'm' in value:
ray = value.split('m')
seconds += int(ray.pop(0)) * 60
value = ''.join(ray)
if value:
ray = value.split('s')
seconds += int(ray.pop(0))
return seconds
except Exception:
pass
return original_value

also, how do you feel about me setting the version as an option and default it to version 2? defaulting to 1 as thats the majority of tests in functional/

from ansible-modules-hashivault.

ventris avatar ventris commented on July 28, 2024

I can see that support for kv v2 engine is now supported but I cant get it to work, is there any examples or documentation regarding this anywhere?

from ansible-modules-hashivault.

drewmullen avatar drewmullen commented on July 28, 2024

Check that pr, there's an example there

from ansible-modules-hashivault.

ventris avatar ventris commented on July 28, 2024

@drewmullen

In that example namespace is specfied which is something that only the pro version offers.
I get the error with copied example, both on read and write. Is the namespace part needed for the kv2 stuff to work?

Task:

    - name: write to kv2
      hashivault_write:
        secret: kv2/test
        data:
            password: mypass
        version: 2
TASK [write to kv2] *****************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error InvalidPath(no handler for route 'secret/data/kv2/test') writing secret/kv2/test", "rc": 1}

from ansible-modules-hashivault.

drewmullen avatar drewmullen commented on July 28, 2024

Looks like an issue on the vault side. Did you upgrade the mount to v2?

I'm off this week but if you're still having trouble next week I can help

*The namespace is optional for any task using this set of modules

from ansible-modules-hashivault.

TerryHowe avatar TerryHowe commented on July 28, 2024

This issue should probably be closed.

from ansible-modules-hashivault.

TerryHowe avatar TerryHowe commented on July 28, 2024

If there is anything else to this or problems I think a new issue would be best.

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.