Replacing extlookup to look up external things!

20 views
Skip to first unread message

Robert Inder

unread,
Jan 29, 2019, 5:45:21 PM1/29/19
to Puppet Users
I'm looking at the possibility of moving our Puppet manifests from 3.8 to Something More Recent (i.e. 6.1)

We have one big CSV file for (mostly) encrypted passwords and the like.
And our existing manifests use extlookup to extract the relevant entries, via calls like pw =

How should I replace this?
Can someone point me at an example of the simplest possible external lookup?

Robert.


Ben Ford

unread,
Jan 29, 2019, 7:17:07 PM1/29/19
to puppet...@googlegroups.com
Your simplest and most straightforward upgrade path would be to port the CSV file to a common.yaml file and then switch to using lookup() with hieradata. Later on, you can start differentiating and build a sane data hierarchy.




--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/7d2122c0-72bf-467f-a7d0-cdac4617504b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Henrik Lindberg

unread,
Jan 31, 2019, 7:48:30 AM1/31/19
to puppet...@googlegroups.com
On 2019-01-30 01:16, Ben Ford wrote:
> Your simplest and most straightforward upgrade path would be to port the
> CSV file to a common.yaml file and then switch to using lookup() with
> hieradata. Later on, you can start differentiating and build a sane data
> hierarchy.
>
> Check out the docs at https://puppet.com/docs/puppet/latest/hiera_quick.html
>

If you really must keep the CSV format, you can write your own function
that you use with hiera 5. It is quite simple. I show examples and
explain how hiera 5 works in this video:
https://www.slideshare.net/PuppetLabs/puppetconf-2017-hiera-5-the-full-data-enchilada-hendrik-lindberg-puppet

You may want to watch that even if you convert your data to yaml.

Best,
- henrik

>
>
> On Tue, Jan 29, 2019 at 2:45 PM Robert Inder <rob...@interactive.co.uk
> <mailto:rob...@interactive.co.uk>> wrote:
>
> I'm looking at the possibility of moving our Puppet manifests from
> 3.8 to Something More Recent (i.e. 6.1)
>
> We have one big CSV file for (mostly) encrypted passwords and the like.
> And our existing manifests use extlookup to extract the relevant
> entries, via calls like pw =
>
> How should I replace this?
> Can someone point me at an example of the simplest possible external
> lookup?
>
> Robert.
>
>
> --
> 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...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> <https://groups.google.com/d/msgid/puppet-users/7d2122c0-72bf-467f-a7d0-cdac4617504b%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CACkW_L6ciVd_FGU7x6Sg%3D-TVpy_rhk1fTW6da31nLNv9XCjNFQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/puppet-users/CACkW_L6ciVd_FGU7x6Sg%3D-TVpy_rhk1fTW6da31nLNv9XCjNFQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Robert Inder

unread,
Feb 5, 2019, 5:03:03 PM2/5/19
to Puppet Users


On Wednesday, 30 January 2019 00:17:07 UTC, Ben Ford wrote:
Your simplest and most straightforward upgrade path would be to port the CSV file to a common.yaml file and then switch to using lookup() with hieradata.

Thanks, Ben.   That worked, and wasn't too painful.

Now all I have to do is get the mailalias module installing and working!

Robert.

Robert Inder

unread,
Feb 5, 2019, 5:08:25 PM2/5/19
to Puppet Users


On Thursday, 31 January 2019 12:48:30 UTC, Henrik Lindberg wrote:

If you really must keep the CSV format, you can write your own function
that you use with hiera 5. It is quite simple. I show examples and
explain how hiera 5 works in this video:
https://www.slideshare.net/PuppetLabs/puppetconf-2017-hiera-5-the-full-data-enchilada-hendrik-lindberg-puppet

You may want to watch that even if you convert your data to yaml.

Thanks for the pointer.
I've gone down the convert-to-yaml route, but I'll look checkout
your video again once we've moved properly to Puppet 6.

Robert.
Reply all
Reply to author
Forward
0 new messages