On Fri, Apr 15, 2022 at 12:34 PM Matt Zagrabelny <[email protected]> wrote:

> 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) ?
>

A little bit more information...

puppet module list does not list the module:

# puppet module list | tail
/usr/share/puppet/modules
├── crayfishx-hiera_mysql (v3.0.1)
├── nanliu-staging (v1.0.4)
├── puppetlabs-apt (v6.1.1)  invalid
├── puppetlabs-concat (v5.1.0)  invalid
├── puppetlabs-mysql (v5.3.0)
├── puppetlabs-postgresql (v5.4.0)
├── puppetlabs-stdlib (v5.0.0)  invalid
├── puppetlabs-translate (v1.1.0)
└── puppetlabs-vcsrepo (v3.0.0)

However, it exists on disk:

# ls -1 /usr/share/puppet/modules
apt
concat
hiera_mysql
hiera-mysql2
mysql
postgresql
staging
stdlib
translate
vcsrepo

Any ideas how to get puppet to see the modules that exist "on disk" ?

Thanks for the help!

-m

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAOLfK3W-m12adKYAzLSS%2B-1PvE_ytMA6Mue2rqPr0qoYux%2BPBg%40mail.gmail.com.

Reply via email to