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

hiera data not being read #319

Open
simmerz opened this issue Nov 16, 2021 · 0 comments
Open

hiera data not being read #319

simmerz opened this issue Nov 16, 2021 · 0 comments

Comments

@simmerz
Copy link

simmerz commented Nov 16, 2021

I've got a spec/hiera.yaml file with spec.yaml as an additional entry so that onceover can get all the data that would otherwise come from a Hashicorp Vault instance. I also have a spec/hieradata directory, and my spec/hiera.yaml looks like:

---
version: 5
defaults:
  datadir: hieradata
  data_hash: yaml_data
hierarchy:
  - name: Common data
    paths:
      - common.yaml

I've got some data in spec/hieradata/common.yaml:

---
classes:
  - 'profile::base'
letsencrypt::email: [email protected]
profile::vault::server::aws_access_key: '1234557'
profile::vault::server::aws_secret_key: 'abcdef'
profile::vault::server::aws_kms_key: 'abcdef1234'
ssh::storeconfigs_enabled: false
profile::traefik::host::letsencrypt_email: [email protected]
profile::traefik::host::docker_network: frontend
profile::redis::docker::docker_network: frontend
traefik::host::auth_password: password
elasticsearch::ca_cert: foobarbaz
elasticsearch::http_cert: foobarbaz
elasticsearch::http_key: foobarbaz
elasticsearch/elastic::password: 'foobar'
elasticsearch/logstash_system::password: 'foobar'

It appears that the hieradata isn't being read at all, as I then get errors like:

profile::traefik::host: failed
  errors:
    error during compilation: Evaluation Error: Error while evaluating a Function Call, Class[Profile::Traefik::Host]:
  expects a value for parameter 'letsencrypt_email'
  expects a value for parameter 'docker_network'
  parameter 'auth_password' expects a String value, got Undef (line: 13, column: 1) on node 08713ae32bdc

I did try to move the spec common.yaml file into my main hieradata directory as hieradata/spec.yaml and just clone the root hiera.yaml, adding spec.yaml to the paths, but this doesn't seem to get read either.

Possibly related: I've always had manifest = site.pp in my environment.conf. If I keep that in, I get the following error:

profile::traefik::host: failed
  errors:
    Function lookup() did not find a value for the name 'classes'

Suggesting that the site.pp is indeed being read, and not ignore, as per the README.

My site.pp is simply:

lookup('classes', Array[String], 'unique').include
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

1 participant