puppet-openldap
puppet-openldap copied to clipboard
Package[openldap] is already declared at
If you already have the package openldap already defined else where with ensure_packages(['openldap-devel', 'openldap', 'openssl'], {'ensure' => 'present'}) you get an error.
Failed on TARGET:
Apply failed to compile for TARGET: Duplicate declaration: Package[openldap] is already declared at (file: /PATH/modules/profile/manifests/ad.pp, line: 3); cannot redeclare (file: /PATH/.modules/openldap/manifests/client/install.pp, line: 8) (file: /PATH/.modules/openldap/manifests/client/install.pp, line: 8, column: 3)
Failed on 1 target: TARGET
We like to define the installed packages explicitly so this is causing us a few issues. Is it possible to make the module do a check to see if this dependency is already defined before adding it again?
Is it possible to make the module do a check to see if this dependency is already defined before adding it again?
I would consider this an anti-pattern: I would expect the module to manage the package, and if the package is managed outside of the module, raise an error like it currently does.
If you have a use case for which managing the package in the module is not great, I would rather suggest adding a parameter manage_package that defaults to true and when set to false skip completely package management, like it is done in various modules.
The use case is that we have explicit package management defined elsewhere. One source of truth for what packages get installed via puppet rather than asking which module installed that or digging through multiple files. It feels weird that I'm getting punished for being detailed and explicit rather than expecting and hoping a module would do it for me.