Skip to content
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

Parsing of encrypted hiera from raw ruby #262

Open
sergii-zemlianyi opened this issue Mar 28, 2018 · 1 comment
Open

Parsing of encrypted hiera from raw ruby #262

sergii-zemlianyi opened this issue Mar 28, 2018 · 1 comment

Comments

@sergii-zemlianyi
Copy link

sergii-zemlianyi commented Mar 28, 2018

Dear all,

We are using a set of ruby+capistrano scripts altogether with hiera to run deployments . Currently we intend to start using eyaml backend.
This is what I have:
here I just initialize eyaml backend and load keys from eyaml files.
Backend.datasourcefiles(:eyaml, scope, 'eyaml', Config[:hierarchy]) do |source, yamlfile|
data = @cache.read_file(yamlfile) do |chunk|
YAML.load(chunk) || {}
end
...

So my first question is: should I then call the following method to decrypt values?
new_answer = parse_answer(data, scope)

if I do so I get the following error

/usr/local/rvm/gems/ruby-1.9.3-p551/gems/hiera-eyaml-2.1.0/lib/hiera/backend/eyaml/encryptors/pkcs7.rb:51:in decrypt': undefined local variable or method private_key' for Hiera::Backend::Eyaml::Encryptors::Pkcs7:Class (NameError)

I believe this is cause Hiera::Backend::Eyaml::Encryptor.option method returns a full hash @@options rather than single private_key value

if all above doesn't make sense which method should I pass my encrypted data into?

Thanks a lot in advance,
Sergey

@spuder
Copy link

spuder commented Sep 24, 2020

Did you ever find a solution to how to use hiera-eyaml in a ruby script?

This may help #153

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

No branches or pull requests

2 participants