Created
September 6, 2014 21:21
-
-
Save deltamualpha/c3a191260352f24eb74e to your computer and use it in GitHub Desktop.
create a proper extension file for an installed php module
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
define php::conf { | |
if $::lsbdistcodename == 'precise' { | |
$php_build = '20090626' | |
file { "/etc/php5/conf.d/${title}.ini": | |
ensure => present, | |
owner => 'root', | |
group => 'root', | |
mode => '0644', | |
content => template("php/conf.d/${title}.ini"), | |
require => Package['php5'] | |
} | |
} elsif $::lsbdistcodename == 'trusty' { | |
$php_build = '20121212' | |
file { "/etc/php5/mods-available/${title}.ini": | |
ensure => present, | |
owner => 'root', | |
group => 'root', | |
mode => '0644', | |
content => template("php/conf.d/${title}.ini"), | |
require => Package['php5'] | |
} | |
if defined(Package['libapache2-mod-php5']) { | |
file { "/etc/php5/apache2/conf.d/20-${title}.ini": | |
ensure => link, | |
owner => 'root', | |
group => 'root', | |
mode => '0644', | |
target => "/etc/php5/mods-available/${title}.ini", | |
require => [File["/etc/php5/mods-available/${title}.ini"], Package['libapache2-mod-php5']] | |
} | |
} | |
if defined(Package['php5-fpm']) { | |
file { "/etc/php5/fpm/conf.d/20-${title}.ini": | |
ensure => link, | |
owner => 'root', | |
group => 'root', | |
mode => '0644', | |
target => "/etc/php5/mods-available/${title}.ini", | |
require => [File["/etc/php5/mods-available/${title}.ini"], Package['php5-fpm']] | |
} | |
} | |
file { "/etc/php5/cli/conf.d/20-${title}.ini": | |
ensure => link, | |
owner => 'root', | |
group => 'root', | |
mode => '0644', | |
target => "/etc/php5/mods-available/${title}.ini", | |
require => File["/etc/php5/mods-available/${title}.ini"] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expects a template file in
modules/php/templates/conf.d/$name.ini
with your .ini content.