Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

trocla_lookup a hierarchy key with dots #4

Open
arlt opened this issue Jan 26, 2018 · 2 comments
Open

trocla_lookup a hierarchy key with dots #4

arlt opened this issue Jan 26, 2018 · 2 comments

Comments

@arlt
Copy link

arlt commented Jan 26, 2018

We have hiera databases inside /etc/puppet and outside. So the trocla_hierarchy path can have dots.

:hierarchy:
  - "../../hieradb/nodes/%{::hostname}"
  - ../../hieradb/common
  - common

We create a password with "%{hiera('trocla_hierarchy::plain::test')}" for the puppet node "xyz".

Result:

  hiera/../../hieradb/nodes/xyz/test: 
    plain: "BNl6M_anzJRBx6WS"

We try to access the passwords with "%{hiera('trocla_lookup::plain::hiera/../../hieradb/nodes/xyz/test')}".

As a result we get this additional entry in trocla.yaml (key has the dots removed):

  hiera/hieradb/nodes/xyz/test: 
    plain: "c4j(/z9[sgjDNj34"

With trocla get 'hiera/../../hieradb/nodes/xyz/test' plain we get the expected password.

@arlt
Copy link
Author

arlt commented Jan 29, 2018

Sometimes (i don't know when/why), the key (for the lookup with dots) is created like this:

  hiera/: 
    plain: ...

The password which i receive in puppet is empty ("").

@arlt
Copy link
Author

arlt commented Feb 20, 2018

I changed :datadir: from /etc/puppet/hieradb to /etc. So ../../ in hierarchy: is not needed anymore.
This is my solution. It's still an issue but in my opinion, you can close it because the result without ../../ looks better, too.

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

No branches or pull requests

1 participant