Skip to content

Commit 085d089

Browse files
author
Tim Meusel
committed
only define package ressource if we havn't already
1 parent 709ae0f commit 085d089

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

manifests/unicorn.pp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
class puppet::unicorn () {
1919
include nginx
2020
# install unicorn
21-
package {['ruby-devel', 'gcc']:
22-
ensure => 'latest',
23-
} ->
21+
$packages = ['ruby-devel', 'gcc']
22+
unless defined(Package[$packages]) {
23+
package {$packages:
24+
ensure => 'latest',
25+
}
26+
}
2427
package {['unicorn', 'rack']:
2528
ensure => 'latest',
2629
provider => 'gem',
30+
require => Package[$packages],
2731
} ->
2832
file {'copy-config':
2933
path => '/etc/puppet/config.ru',

0 commit comments

Comments
 (0)