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

On Thu, Apr 14, 2022 at 1:21 AM Martin Alfke <tux...@gmail.com> wrote:

> Hi,
>
> We usually recommend to not use any other backend, except for file based
> backends, due to performance.
> Any other backend must be able to deliver the same lookup speed.
> We did a calculation at a customer and we saw hiera answering 8000 queries
> in less than 1 second using the yaml file backend.
>
> With hiera5 you can of course write new backends.
> Please note that the hiera3 backends are not compatible with hiera5!
> https://puppet.com/docs/puppet/7/hiera_custom_backends.html
>
> Hth,
> Martin
>
>
> On 14. Apr 2022, at 04:30, 'Matt Zagrabelny' via Puppet Users <
> puppet-users@googlegroups.com> wrote:
>
> Greetings,
>
> I'm running puppet 5.5.
>
> Is anyone aware of a hiera 5 Pg backend?
>
> I've tried getting the hiera 3 module [0] working, but am struggling. I'm
> hoping a native hiera 5 will be a smoother experience.
>
> Thanks for the help!
>
> -m
>
> [0] https://github.com/rogeduardo/hiera-psql
>
>
>
> --
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAOLfK3U6euXrZfWHLcSWjm-BHrxLq0oir8p2x-O4ExMe1TCrdA%40mail.gmail.com
> <https://groups.google.com/d/msgid/puppet-users/CAOLfK3U6euXrZfWHLcSWjm-BHrxLq0oir8p2x-O4ExMe1TCrdA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
> --
> 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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/4EF8FA1E-3BA5-4B4D-B3E5-CCCF24981D03%40gmail.com
> <https://groups.google.com/d/msgid/puppet-users/4EF8FA1E-3BA5-4B4D-B3E5-CCCF24981D03%40gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAOLfK3W3cJx00gwP%3Do0yyWHRMu%2BvV4fvu28L%3DikNORF8K6FH8Q%40mail.gmail.com.

Reply via email to