Skip to content

Commit

Permalink
only install curl if it isn't defined elsewhere
Browse files Browse the repository at this point in the history
If ensure_package() is used with a conventional resource declaration
such as `package { 'curl': ensure => present, }`, it could result in
a duplicate resource error. This commit ensures that curl is not
declared if it's already defined elsewhere, such as a site-wide packages
class.
  • Loading branch information
Roger Ignazio committed May 13, 2014
1 parent 478d842 commit d1943ad
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions manifests/system.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
}

# curl needs to be installed
case $::kernel {
Linux: {
ensure_packages(['curl'])
Package['curl'] -> Exec['system-rvm']
if ! defined(Package['curl']) {
case $::kernel {
Linux: {
ensure_packages(['curl'])
Package['curl'] -> Exec['system-rvm']
}
default: {}
}
default: {}
}

exec { 'system-rvm':
Expand Down

0 comments on commit d1943ad

Please sign in to comment.