[Puppet Users] Need help with defining same package resource in two modules

Mani Devarajan
Tue, 17 Sep 2013 05:49:58 -0000

Hello all,
 I have two puppet modules A & B. A module is enabled or disabled with flag
set to true or false respectively.
 I need a package pkg1 to do complete the workflow of B.

Module A:
package { "pkg1":
    ensure => "installed"
 }

Module B:
package { "pkg1":
    ensure => "installed"
 }

Case1: A=false, When the B module runs, pkg1 is installed and works fine.

Case2: A=true, when B runs it fails
Error 400 on SERVER:
Duplicate definition: Package[pkg1] is already defined in
file A at line ; cannot redefine at

How do i overcome this issue to complete the workflow of module B in both
cases (where A is enabled or disabled)

Thanks,
Mani