dev/provisioning/modules/sysconfig/manifests/php.pp
changeset 28 b0b56e0f8c7f
child 30 7ca52d7235ed
equal deleted inserted replaced
27:a2342f26c9de 28:b0b56e0f8c7f
       
     1 class sysconfig::php (
       
     2 ) inherits sysconfig::params {
       
     3 
       
     4     $php_packages = [
       
     5         'php56',
       
     6         'php56-php',
       
     7         'php56-php-common',
       
     8         'php56-php-mbstring',
       
     9         'php56-php-mcrypt',
       
    10         'php56-php-pdo',
       
    11         'php56-php-pecl-memcache',
       
    12         'php56-php-gd',
       
    13         'php56-php-mysqlnd',
       
    14         'php56-php-pecl-imagick'
       
    15     ]
       
    16 
       
    17     package { $php_packages:
       
    18         ensure => present,
       
    19         require => Package["httpd"]
       
    20     }
       
    21 
       
    22     file { '/var/log/php':
       
    23         ensure => directory,
       
    24         owner => 'apache',
       
    25         group => 'apache'
       
    26     }
       
    27 
       
    28     augeas { "php_ini/memory_limit":
       
    29         lens    => "PHP.lns",
       
    30         incl    => "/opt/remi/php56/root/etc/php.ini",
       
    31         changes => "set PHP/memory_limit 128M",
       
    32         notify => Service['httpd'],
       
    33         require => Package["php56"]
       
    34     }->
       
    35     augeas { "php_ini/max_execution_time":
       
    36         lens    => "PHP.lns",
       
    37         incl    => "/opt/remi/php56/root/etc/php.ini",
       
    38         changes => "set PHP/max_execution_time 50",
       
    39         notify => Service['httpd'],
       
    40         require => Package["php56"]
       
    41     }->
       
    42     augeas { "php_ini/upload_max_filesize":
       
    43         lens    => "PHP.lns",
       
    44         incl    => "/opt/remi/php56/root/etc/php.ini",
       
    45         changes => "set PHP/upload_max_filesize 50M",
       
    46         notify => Service['httpd'],
       
    47         require => Package["php56"]
       
    48     }->
       
    49     augeas { "php_ini/error_log":
       
    50         lens    => "PHP.lns",
       
    51         incl    => "/opt/remi/php56/root/etc/php.ini",
       
    52         changes => "set PHP/error_log /var/log/php/php_errors.log",
       
    53         notify => Service['httpd'],
       
    54         require => [Package["php56"], File['/var/log/php']]
       
    55     }
       
    56 #TODO : set php log
       
    57     file { "/var/www/html/phpinfo.php":
       
    58         mode   => 440,
       
    59         owner  => 'apache',
       
    60         group  => 'apache',
       
    61         source => "puppet:///modules/sysconfig/phpinfo.php"
       
    62     }
       
    63 
       
    64 }