noob question about configuring modules via hiera's common.yaml instead of site.pp

68 views
Skip to first unread message

Peter K

unread,
Feb 27, 2017, 12:17:59 PM2/27/17
to Puppet Users
I see the value of keeping data separate from code via hiera...but I'm missing something in when it comes to using a pre-built module that wasn't designed to be used with hiera.
I'm working with bodgit's openldap module and I can get it to work when I put the configuration data into site.pp...but I can't figure out how to re-factor the configuration to live in my common.yaml.
My only idea is to create my own module that call's bodgit's openldap module but provides variables that hiera can call. Here's the code that works in my site.pp:

node default { 
        class { '::openldap':
          tls_cacertdir => '/etc/openldap/certs',
          base   => 'ou=People,dc=example,dc=com',
          uri    => ['ldap://auth.example.com/'],
        }
                
        include ::openldap::client # this installs the openldap client software:
 }

Feel free to point me to what I need to read. I feel I'm missing some concepts.
thx,
-peter 

Bill Sirinek

unread,
Feb 28, 2017, 8:11:29 AM2/28/17
to Puppet Users
We run into that fairly regularly, and what you describe is pretty much what we have done in most cases... Create a ldap profile class that all nodes (or whichever) run, and from that it calls the openldap module with variables you get from hiera.

Bill

Peter K

unread,
Feb 28, 2017, 12:27:36 PM2/28/17
to Puppet Users
Thank you Bill.
-peter
Reply all
Reply to author
Forward
0 new messages