The roles/profile pattern does not use node inheritance, only class inheritance. Strictly speaking, this isn't even necessary, it can just make some things easier.
At my company, we don't even use any real node definition, everything is done with an ENC and hiera. The roles/profile model still fits here, and we use it actively, as do many other people. A role is just a simple class, that includes roles (mostly), there is only 1 'node' definition in the manifests: default. It goes something like this: ENC assigns a node to a role (regular class), a role includes 1 or more profiles and sometimes some extra stuff such as packages (RPM) the profile does the actual modules. Also there is still hiera in all this, mostly using the automatic class parameters. A node actually gets both the 'default' node definition and the 'role'. On Tuesday, November 18, 2014 4:50:33 PM UTC+1, Craig White wrote: > > It seems that node inheritance is deprecated in Puppet 4 so this is a no > go (role/profiles). > > I suppose I should have mentioned that I will be using an ENC so I am > trying to keep the cruft inside node definitions to a minimum which is why > I am struggling to find a way to create a class - certainly I can create a > new wl class for this but then I am struggling to make these things work > inside a class. > > On Tuesday, November 18, 2014 5:32:54 AM UTC-7, Steven Post wrote: >> >> Hi Craig, >> >> If you scroll down on the website you mentioned, you'll see some usage >> instructions. >> I recommend *not* to change the module (not even adding your own wl.pp >> file inside), but to set up your wl.pp file elsewhere. >> You can use your own class (wl.pp, located outside this module) to set up >> the LDAP configuration using the module. >> >> I use the roles/profile setup, but you can leave the roles out if that is >> easier for you, it takes some time getting to really know it all. >> That said, the ldap module controls ldap, but not your node. >> your node should have some other class assigned to it (such as wl.pp), >> which then uses the ldap module, unchanged. >> More info about the roles/profile pattern: >> http://www.craigdunn.org/2012/05/239/ >> One of the ideas here is that you should never need to change a module >> you download from the forge (with some rare exceptions) >> >> Regards, >> Steven >> >> On Monday, November 17, 2014 11:40:28 PM UTC+1, Craig White wrote: >>> >>> Not that it matters, but I am trying to use a module out of puppet forge >>> - camptocamp-openldap >>> https://github.com/camptocamp/puppet-openldap >>> >>> There's no hint of using it anywhere >>> >>> It has an unusual style. There isn't any init.pp and the structure looks >>> like this... >>> >>> ├── client >>> │ ├── config.pp >>> │ ├── install.pp >>> │ ├── ldapvi.pp >>> │ └── utils.pp >>> ├── client.pp >>> ├── server >>> │ ├── access.pp >>> │ ├── config.pp >>> │ ├── database.pp >>> │ ├── dbindex.pp >>> │ ├── globalconf.pp >>> │ ├── install.pp >>> │ ├── module.pp >>> │ ├── overlay.pp >>> │ ├── service.pp >>> │ └── slapdconf.pp >>> ├── server.pp >>> └── wl.pp >>> >>> The last file - wl.pp is my own file and it looks like this... >>> >>> $ensure = present >>> $directory = '/var/lib/ldap' >>> $rootdn = 'cn=admin,dc=wl,dc=com' >>> $rootpw = 'password' >>> $dn = 'dc=wl,dc=com' >>> >>> # Install openldap server >>> class { 'openldap::server': >>> } >>> >>> openldap::server::database { $dn: >>> ensure => present, >>> rootdn => "cn=admin,${dn}", >>> rootpw => $rootpw, >>> } >>> >>> and if I use 'puppet apply -vd --modulepath /etc/puppet/modules wl.pp >>> >>> it works fine but I can't put those variables into the server.pp file or >>> any of the files in the /server subdirectory because they don't work. >>> >>> I need a method - I thought a class openldap::wl class but I can't make >>> that work either. How do I structure this so I can use one class to >>> configure clients without resorting to re-writing the module completely so >>> it comports to a style that I understand? >>> >> -- 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/9771a548-5553-46d9-9915-fb1e467c63f5%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.