Comments (5)
Hi @kbrede,
A few questions that will help to give a little more context to your issue:
- what does the rest of your hiera.yaml look like?
- how are you running puppet - is that on a real host?
To help you troubleshoot I recommend testing hiera directly without puppet. You can do that using the hiera command line tool. Without the rest of your hiera.yaml config file I can't tell exactly what command you'll need to run, but something like hiera -c /path/to/hiera.yaml test hostname=hostname
should do the trick (you can specify 'fact' key value pairs you need to provide at the end of the command).
Regards,
Simon
from hiera-eyaml.
Thanks for your help Simon. I'm getting closer.
After adding:
:backends:
-eyaml
Commenting out:
:extension: 'yaml'
Changing:
/etc/puppet/hieradata/hosts/puppet.yaml
to /etc/puppet/hieradata/hosts/puppet.eyaml
And changing:
"hosts/%{::hostname}"
to "hosts/%{hostname}"
I can now pull back the encrypted string unencrypted with:
hiera -c /etc/puppet/hiera.yaml test_val hostname=puppet
But Puppet is not able to unencrypt the string. It still shows up in the file as:
ENC[PR............VggBD652vwNiSvudBq6wuyHRpn]
My current hiera.yaml file is posted below. I'm running puppet as "puppet agent -t" and "puppet" is a real host. -- Thanks.
hiera.yaml
:backends:
- yaml
- eyaml
:yaml:
:datadir: /etc/puppet/hieradata
:eyaml:
:datadir: /etc/puppet/hieradata
#:extension: 'yaml'
:pkcs7_private_key: /etc/puppet/secure/keys/private_key.pkcs7.pem
:pkcs7_public_key: /etc/puppet/secure/keys/public_key.pkcs7.pem
:hierarchy:
- "%{virtual}"
- "%{architecture}"
- "%{operatingsystemmajrelease}"
- "hosts/%{hostname}"
- common
- global
from hiera-eyaml.
Good to hear you're getting there.
So first of all, I'd be tempted to temporarily remove the 'yaml' backend to make sure you are not inadvertently retrieving an encrypted value through the default backend. I tend to put eyaml first in backend list so I hit that first and fall back to normal yaml files second.
Sounds like it is picking up the right file, as you are getting something back rather than an error. That implies the hostname fact is correct - but maybe check that hostname is what you expect on the box you are running puppet apply
on using the facter -p
command.
Other than this is looks like it should work - the keys are clearly correct if the hiera command is working. Perhaps try running puppet in debug mode and see if that gives any clues.
Are you using a simple puppet manifest (one that just writes a file or similar)? If so can you post that for completeness?
from hiera-eyaml.
Solved! All I had to do is put the 'eyaml' backend above 'yaml' as you suggested.
Once I did that I was also able to add back:
:extension: 'yaml'
Yep, I was just using a simple file type, for testing:
file { '/tmp/test.txt':
ensure => present,
content => $test_val,
}
Thanks for your help!
Kent
from hiera-eyaml.
Great :)
You're welcome - I'm going to close this issue. Good luck rolling it out.
from hiera-eyaml.
Related Issues (20)
- Recrypt shouldn't default to changing encryption
- Automatically convert encrypted values to Sensitive[T] HOT 4
- Error during hiera-eyaml gem installation
- hiera-eyaml Error was PKCS7[Method: 112, Reason: 115, Data: null] when using mutiple public private keys HOT 2
- Concerns about the encrypted? method HOT 2
- Gpg recrypt emits error about missing pkcs7 key HOT 2
- Using `3.2.1` for editing an eyaml created with `3.2.0` will mess up formatting HOT 11
- Subsequent "eyaml encrypt -s test" calls return different signatures HOT 2
- Incompatability with ruby 3.1.0 HOT 7
- lookup example with default parameter if decrypt fails HOT 3
- get return values instead of fatal errors
- Unable to encrypt string that begins with two or more hyphens (dashes) HOT 1
- Ruby >= 2.5.0 silently required since hiera-eyaml v3.2.3?
- Uneeded config warnings when using keys in env vars ([pkcs7] both public_key and public_key_env_var specified, using public_key)
- Allow execution of Puppet functions from Hiera HOT 4
- Allow Hash keys as Array HOT 2
- Encrypt yaml file on my workstation and push to git HOT 1
- Remote Code Execution vulnerability in the hiera-eyaml tool HOT 2
- Release a new version HOT 2
- multi-line yaml broken in decrypt output
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hiera-eyaml.