[Puppet Users] Re: transitioning a file resource

jcbollinger
Thu, 03 May 2012 13:09:02 -0000

On May 2, 6:10 pm, Craig White <craig.wh...@ttiltd.com>
wrote:
> for reasons probably not important to the discussion, I am trying to
transition my Ubuntu setups from using libnss-ldap / libpam-ldap over to the
libnss-ldapd / libpam-ldapd. There some files that have minor differences such
as /etc/pam.d/common-session.
>
> So I have my ldap module which manages this file and all my servers are
currently using this setup.
>
> I have essentially duplicated the ldap module into ldap_alt module which I
thought could peaceably coexist with the ldap module as long as both
weren''t assigned but alas...


Indeed they could and should.


> notice: Ignoring --listen on onetime run
> info: Retrieving plugin
> info: Loading facts in passenger_version
> info: Loading facts in datacenter
> info: Loading facts in passenger_version
> info: Loading facts in datacenter
> err: Could not retrieve catalog from remote server: Error 400 on SERVER:
Duplicate definition: File[/etc/pam.d/common-session] is already defined in file
/etc/puppet/modules/ldap/manifests/configure.pp at line 103; cannot redefine at
/etc/puppet/modules/ldap_alt/manifests/configure.pp:103 on node nxpc.ttinet
> warning: Not using cache on failed catalog
> err: Could not retrieve catalog; skipping run
>
> which makes me think that I will have to have to do all of the package
management within a single module unless I am missing something.


Very likely you are missing something.  Puppet should not even be
reading both the configure.pp files unless the classes therein are
both assigned to your node, directly or indirectly.  Since you created
one module by duplicating the other, my guess would be that you missed
changing one or more namespaces in the copy, leaving them referring to
the original module.  For example, you might have something like this:

ldap_alt/manifests/foo.pp:
-----------------------------------
class ldap_alt::foo {
    # oops:
    include ''ldap::configure''
    ...
}


You could try grepping ldap_alt''s manifest for the string
"ldap::".


John