On Monday, November 17, 2014 4:40:28 PM UTC-6, 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... >
It *is* a bit unusual to not have an init.pp, but only because it has become so common for each module to have an eponymous class (i.e. a class "openldap" in this case). This module does not need or want that because the client and server pieces share nothing. The init.pp is not a qualification for being a module, nor is it automatically loaded in general, it is just the manifest where Puppet expects to find the definition of the eponymous class, if there is one. > > ├── 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 > > Other than not having an init.pp, that doesn't look particularly strange to me. It's a bit *big*, but there are a lot of pieces to manage. > 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, > } > > Oh no, no, no. You should not add code to a module in order to *use* the module. Moreover, you should have top-level declarations only in your site manifest. Your wl.pp is in fact functioning as a site manifest when you name it in a 'puppet apply' run, so it's not necessarily wrong in itself, it just doesn't belong in the module (and putting it there confers no particular advantage). > 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'm not clear on what you're trying to do. When you say "it works" do you mean that wl.pp achieves everything you're after, or just that it runs without error? > > 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? > Well, it *looks* like you configure clients by declaring instances of class openldap::client, which sounds like what you want. The module seems actually to have reasonably good documentation, including examples, at the URL you provided. John -- 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/e31dcccd-5746-4771-bc79-5b2c9be887b7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.