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

New hiera.yaml v5 format misses eyaml options #206

Open
tmannerm opened this issue Sep 17, 2017 · 7 comments
Open

New hiera.yaml v5 format misses eyaml options #206

tmannerm opened this issue Sep 17, 2017 · 7 comments

Comments

@tmannerm
Copy link

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.5 as included in PE 2016.4.7
  • Ruby: 2.1.9p490 as included in PE 2016.4.7
  • Distribution: CentOS 6.9
  • Module version: 3.1.0

How to reproduce (e.g Puppet code you use)

Update to v3.1.0 with "eyaml => true" in the manifest. Only added hiera_version and hiera5_defaults params and converted hierarchy as is to the new syntax (with only name and path keys).

What are you seeing

Eyaml encryption is no longer working because options hash with private/public keys and required lookup_key are missing from the generated hiera.yaml v5 format.

What behaviour did you expect instead

Eyaml encryption still working just like in the hiera.yaml v3 format.

Any additional information you'd like to impart

I chose not to convert to environment specific hiera.yaml so I use this module to generate global hiera.yaml but just with new v5 format.

@elmobp
Copy link

elmobp commented Oct 4, 2017

Heya,

eyaml syntax has changed in v5 see my example below in hiera

---
classes:
  - hiera

hiera::hiera_version: '5'
hiera::hiera5_defaults::datadir: 'data'
hiera::hiera5_defaults::data_hash: 'yaml_data'
hiera::manage_package: true
hiera::hierarchy:
  - name: 'trusted'
    path: 'nodes/%{::trusted.certname}'
    lookup_key: 'eyaml_lookup_key'
    options:
      pkcs7_private_key: /etc/puppetlabs/puppet/keys/private_key.pkcs7.pem
      pkcs7_public_key:  /etc/puppetlabs/puppet/keys/public_key.pkcs7.pem
      extension: yaml

Note: lookup_key and options

@flix444
Copy link

flix444 commented Dec 18, 2017

Hey elmobp,
how i use this in a separated module?
`
class { 'hiera':

hiera_version => '5',

hiera5_defaults => {"datadir" => "data", "data_hash" => "yaml_data"},
}
`

@dan-wittenberg
Copy link
Contributor

For an "approved" module it seems a big gap to not have eyaml working after many months, any plans to fix this?

@ragnarkon
Copy link

@dan-wittenberg Eyaml seems to works fine.

@flix444 Example below.

class { 'hiera':
  hiera_version => '5',
  hiera5_defaults => {
    'datadir' => "${::settings::codedir}/data",
    'data_hash' => 'yaml_data'
  },
  hierarchy           => [
    # "Common" entry
    { 'name' => 'common', 'path' => 'common.yaml' },
    # "Common" entry with Eyaml
    { 'name' => 'e common',
      'path' => 'common.eyaml',
      'lookup_key' => 'eyaml_lookup_key',
      'options' => {
        'pkcs7_private_key' => "${keys_dir}/private_key.pkcs7.pem",
        'pkcs7_public_key' => "${keys_dir}/public_key.pkcs7.pem"}}
  ],
  keysdir => $keys_dir
  # etc etc
}

@dan-wittenberg
Copy link
Contributor

dan-wittenberg commented Apr 13, 2018 via email

@jflorian
Copy link

jflorian commented Dec 1, 2018

I do think this issue is somewhat relevant and should remain open. At the very minimum, the README.md could really benefit from a Hiera 5 with eyaml example. I was only able to get mine working because of the examples shown here. The docs made my old Hiera (3?) setup easy but the transition to 5 had me stumped until I got here.

Also, if I'm using the same keys for each of my hierarchy paths, is there any way to to provide the lookup_key and/or options in the hiera5_defaults (or elsewhere) so as to not have to repeat that for every single hierarchy path? Flexible: yes; concise no.

@cabrinha
Copy link

yeah, i agree that the README should be updated to make the differences between hiera v3 and v5 more clear.

I'll see if I can open a PR to get the docs into a better state.

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

7 participants