Hi Martin,
Thanks for the email. I understand your concerns about using other backends. We have a reasonably small puppet deployment, so I think I will try a DB based backend and see how it performs.
In that light, I've downloaded a hiera-mysql2 module from github and installed it at:
# tree /usr/share/puppet/modules/hiera-mysql2
/usr/share/puppet/modules/hiera-mysql2
├── CHANGELOG.md
├── lib
│ └── puppet
│ └── functions
│ └── mysql2_lookup_key.rb
├── LICENSE
├── metadata.json
└── README.md
I've updated my /etc/puppet/hiera.yaml to include an entry for looking up data using hiera-mysql2:
# head /etc/puppet/hiera.yaml
version: 5
defaults:
datadir: /etc/puppet/code/hiera
data_hash: yaml_data
hierarchy:
- name: "MySQL lookup"
lookup_key: mysql2_lookup_key
options:
And I've restarted my puppetmaster.
When I attempt a lookup, either locally on the puppet master (or on an client system via puppet agent -t), I get:
# puppet lookup foo::bar --explain
Searching for "lookup_options"
Global Data Provider (hiera configuration version 5)
Using configuration "/etc/puppet/hiera.yaml"
Hierarchy entry "MySQL lookup"
Unable to find 'lookup_key' function named 'mysql2_lookup_key' (file: /etc/puppet/hiera.yaml)
I did not use "puppet module" to install the module, I just copied the files to the directory.
My module path looks good. Notice the last entry in the following path output...
# puppet config print modulepath
/etc/puppet/code/environments/production/modules:/etc/puppet/code/environments/production/profiles:/etc/puppet/code/environments/production/roles:/etc/puppet/modules:/etc/puppet/profiles:/etc/puppet/roles:/usr/share/puppet/modules
Can anyone help me understand why the puppetmaster isn't seeing the hiera-mysql2 module (and function contained therein) ?
Thank you for your consideration.
-m