dev/provisioning/modules/sysconfig/manifests/php.pp
author ymh <ymh.work@gmail.com>
Wed, 23 Nov 2016 08:12:12 +0100
changeset 437 7693515f2e4a
parent 325 31a4987f6017
permissions -rw-r--r--
replace php-memcache by php-memcached, slight build improvement

class sysconfig::php (
) inherits sysconfig::params {

    $php_packages = [
        'php56',
        'php56-php',
        'php56-php-common',
        'php56-php-mbstring',
        'php56-php-mcrypt',
        'php56-php-pdo',
        'php56-php-pecl-memcached',
        'php56-php-gd',
        'php56-php-mysqlnd',
        'php56-php-pecl-imagick'
    ]

    package { $php_packages:
        ensure => present,
        require => Package["httpd"]
    }

    file { '/var/log/php':
        ensure => directory,
        owner => 'apache',
        group => 'apache',
        require => Package["httpd"]
    }

    augeas { "php_ini/memory_limit":
        lens    => "PHP.lns",
        incl    => "/opt/remi/php56/root/etc/php.ini",
        changes => "set PHP/memory_limit 512M",
        notify => Service['httpd'],
        require => Package["php56"]
    }->
    augeas { "php_ini/max_execution_time":
        lens    => "PHP.lns",
        incl    => "/opt/remi/php56/root/etc/php.ini",
        changes => "set PHP/max_execution_time 50",
        notify => Service['httpd'],
        require => Package["php56"]
    }->
    augeas { "php_ini/upload_max_filesize":
        lens    => "PHP.lns",
        incl    => "/opt/remi/php56/root/etc/php.ini",
        changes => "set PHP/upload_max_filesize 50M",
        notify => Service['httpd'],
        require => Package["php56"]
    }->
    augeas { "php_ini/error_log":
        lens    => "PHP.lns",
        incl    => "/opt/remi/php56/root/etc/php.ini",
        changes => "set PHP/error_log /var/log/php/php_errors.log",
        notify => Service['httpd'],
        require => [Package["php56"], File['/var/log/php']]
    }
#TODO : set php log
    file { "/var/www/html/phpinfo.php":
        mode   => 440,
        owner  => 'apache',
        group  => 'apache',
        source => "puppet:///modules/sysconfig/phpinfo.php",
        require => Package["httpd"]
    }

}