Skip to content

Instantly share code, notes, and snippets.

@deploylinux
Created April 20, 2011 04:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deploylinux/930399 to your computer and use it in GitHub Desktop.
Save deploylinux/930399 to your computer and use it in GitHub Desktop.
trying to figure out how to dynamically expand puppet service resource subscriptions - this code compiles but is it correct/will it work?
if $imagemagick_php {
$phpimagick = 'pecl-imagick'
} else {
$phpimagick = ''
}
$phpfpmsub = [ File['/etc/php/fpm-php5.3/php-fpm.conf','/etc/php/fpm-php5.3/php.ini'], Package['php',$phpimagick], ]
service {"php-fpm":
name => "php-fpm",
enable => "true",
ensure => "running",
hasstatus => "true",
subscribe => $phpfpmsub,
}
@barn
Copy link

barn commented Apr 20, 2011

if $imagemagick_php {
        $phpimagick = 'pecl-imagick'
 } else {
        $phpimagick = undef
 }

 $phpfpmsub = [ File['/etc/php/fpm-php5.3/php-fpm.conf','/etc/php/fpm-php5.3/php.ini'], Package['php',$phpimagick], ]

 service {"php-fpm":
   name      => "php-fpm",
   enable    => "true",
   ensure    => "running",
   hasstatus => "true",
   subscribe => $phpfpmsub,
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment