Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
PUP 4.9.4
-
None
-
None
-
OS: Ubuntu 14.04.5
Puppet Agent: 1.9.3/4.9.4
-
Puppet Developer Experience
-
1
-
PDE 2017-03-22, PDE 2017-04-05
-
Bug Fix
-
If all keys specifying {{lookup_options}} in hiera data files were based on regular expression patterns, puppet would crash. This is now fixed. A work around while waiting for the fix is to add a lookup options for a dummy fixed key.
-
No Action
-
covered by unit tests
Description
UPDATE
When regular expression keys are using in lookup_options an error is raised if all of the lookup_option keys are regular expression.
A work around until this is fixed is to add a dummy, non regular expression key.
ORIGINAL
root@mbaur-hieradebug:/etc/puppetlabs/code/environments/production# cat hiera.yaml |
version: 5 |
defaults:
|
datadir: hieradata
|
data_hash: yaml_data
|
hierarchy:
|
- name: "Per-node data (yaml version)" |
path: "nodes/%{trusted.certname}.yaml" # Add file extension. |
# Omitting datadir and data_hash to use defaults.
|
|
- name: "Other YAML hierarchy levels" |
paths: # Can specify an array of paths instead of one.
|
- "location/%{facts.whereami}/%{facts.group}.yaml" |
- "groups/%{facts.group}.yaml" |
- "os/%{facts.os.family}.yaml" |
- "common.yaml" |
root@mbaur-hieradebug:/etc/puppetlabs/code/environments/production# cat hieradata/common.yaml |
---
|
classes:
|
- foobar
|
lookup_options:
|
"^profile::(.*)::users$": # Regexp: `$users` parameter of any profile class |
merge: # Merge behavior as a hash
|
strategy: deep
|
merge_hash_arrays: true |
root@mbaur-hieradebug:/etc/puppetlabs/code/environments/production# puppet lookup classes |
Error: Could not run: undefined method `[]' for nil:NilClass |
The following things has been changed compared to an pure puppet-agent installation:
- /etc/puppetlabs/puppet/hiera.yaml deleted
- /etc/puppetlabs/code/environments/production/hiera.yaml created with code from https://docs.puppet.com/puppet/4.9/hiera_migrate_v3_yaml.html#translating-built-in-backends . Only the datadir was changed to hieradata
- /etc/puppetlabs/code/environments/production/hieradata/common.yaml was created. For code see above.
Attachments
Issue Links
- links to