Created
September 23, 2012 04:47
-
-
Save big-samantha/3768911 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#extensionname should be the file to load in the ini, e.g. mongo.so | |
define pear::installpackage ( | |
$packagename = $title, | |
$packageversion, | |
$extensionname, | |
$execpath = ['/usr/local/sbin','/usr/local/bin','/usr/sbin','/usr/bin','/sbin','/bin'], | |
$execuser = 'root' | |
) { | |
exec { "${packagename}-${packageversion}": | |
command => "/usr/bin/pear install ${packagename}-$packageversion", | |
user => "$execuser", | |
path => "$execpath", | |
creates => "/etc/php5/conf.d/${packagename}-${packageversion}.ini", | |
logoutput => true, | |
} | |
file { "${extensionname}.ini": | |
content => "extension=${extensionname}.so", | |
path => "/etc/php5/conf.d/${extensionname}.ini", | |
owner => 'root', | |
group => 'root', | |
require => Exec["${packagename}-${packageversion}"], | |
notify => Service['httpd'], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment