]> gitweb.fluxo.info Git - puppet-php.git/commitdiff
Coding style; squeeze upgrade
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 27 Jan 2013 18:19:33 +0000 (16:19 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 27 Jan 2013 18:19:33 +0000 (16:19 -0200)
manifests/init.pp

index 561f31086b3c235c1c3fdb760c0a6b6c40355d60..7813b41f4b00901f84d2cce183db8565f69bc35a 100644 (file)
@@ -1,18 +1,18 @@
 # This module is distributed under the GNU Affero General Public License:
-# 
+#
 # PHP module for puppet
 # Copyright (C) 2009 Sarava Group
-# 
+#
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU Affero General Public License as
 # published by the Free Software Foundation, either version 3 of the
 # License, or any later version.
-# 
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU Affero General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU Affero General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
@@ -20,32 +20,39 @@ class php {
   include pear
 
   # The needed packages
-  package { [ "php5", "php5-mysql", "php5-cli", "php5-ffmpeg", "php5-curl", "php5-gmp" ]:
+  package { [ 'php5', 'php5-mysql', 'php5-cli', 'php5-ffmpeg', 'php5-curl', 'php5-gmp' ]:
     ensure => installed,
   }
 
   # Not available on wheezy
-  package { "php5-suhosin":
-    ensure => $lsbdistcodename ? {
+  package { 'php5-suhosin':
+    ensure => $::lsbdistcodename ? {
       'wheezy' => absent,
       default  => present,
     },
   }
 
+  # Useful when upgrading from squeeze
+  if $::lsbdistcodename == 'wheezy' {
+    file { [ '/etc/php5/apache2/conf.d/suhosin.ini', '/etc/php5/conf.d/suhosin.ini' ]:
+      ensure => absent,
+    }
+  }
+
   # The needed apache modules
-  apache::module { "php5":
+  apache::module { 'php5':
     ensure  => present,
   }
 
-  file { "/etc/php5/cli/php.ini":
+  file { '/etc/php5/cli/php.ini':
     ensure  => present,
     owner   => root,
     group   => root,
     mode    => 0644,
-    source  => [ "puppet:///modules/site_php/cli/$fqdn/php.ini",
-                 "puppet:///modules/site_php/cli/$domain/php.ini",
-                 "puppet:///modules/php/cli/php.${operatingsystem}_${lsbdistcodename}.ini",
-                 "puppet:///modules/php/cli/php.${operatingsystem}.ini",
+    source  => [ "puppet:///modules/site_php/cli/${::fqdn}/php.ini",
+                 "puppet:///modules/site_php/cli/${::domain}/php.ini",
+                 "puppet:///modules/php/cli/php.${::operatingsystem}_${::lsbdistcodename}.ini",
+                 "puppet:///modules/php/cli/php.${::operatingsystem}.ini",
                  "puppet:///modules/php/cli/php.ini" ],
     require => Package['php5-cli'],
   }
@@ -55,10 +62,10 @@ class php {
     owner   => root,
     group   => root,
     mode    => 0644,
-    source  => [ "puppet:///modules/site_php/apache2/$fqdn/php.ini",
-                 "puppet:///modules/site_php/apache2/$domain/php.ini",
-                 "puppet:///modules/php/cli/php.${operatingsystem}_${lsbdistcodename}.ini",
-                 "puppet:///modules/php/cli/php.${operatingsystem}.ini",
+    source  => [ "puppet:///modules/site_php/apache2/${::fqdn}/php.ini",
+                 "puppet:///modules/site_php/apache2/${::domain}/php.ini",
+                 "puppet:///modules/php/cli/php.${::operatingsystem}_${::lsbdistcodename}.ini",
+                 "puppet:///modules/php/cli/php.${::operatingsystem}.ini",
                  "puppet:///modules/php/apache2/php.ini" ],
     notify  => Service['apache2'],
     require => Package['php5'],
@@ -66,7 +73,7 @@ class php {
 }
 
 class php::imap inherits php {
-  package { "php5-imap":
+  package { 'php5-imap':
     ensure => installed,
   }
 }