puppet-php is a puppet module to manage PHP on your systems. You can manage the CLI, Apache and FPM version of PHP.
include php
include php::apache2
include php::fpm
php::module { "snmp":
notify => [ Class["php::fpm::service"], Service["apache"], ],
}
This will install the PHP SNMP module and notifies FPM and Apache about the change. You are also able to set require => Foo["Bar"] if you need anything else, like sources lists before.
php::module { "snmp":
source => "puppet:///files/php/conf.d/",
notify => Class["php::fpm::service"],
}
php::module { "snmp":
content => "php/conf.d/",
notify => Service["apache"],
}
php::conf { "global":
source => "puppet:///files/php/global.ini",
}
php::extra { "lite_php_browscap":
source => "puppet:///files/php/extra/lite_php_browscap.ini",
require => Php::Conf["browscap"],
notify => Class["php::fpm::service"],
}
If a module needs some configuration, you have 3 different options to place this file on the target system.
-
Config comes with the package: Puppet should leave the file as-is
-
Copy a file from the puppet fileserver to the target system
-
Use a template
There is nothing special. Just use php::module, php:conf or php:extra and do not specify a source or content.
The parameter for 'source =>' must be a directory with a trailing slash. The file must be named after the resource.
Example: php::module['xdebug'] source => 'puppet:///files/php/conf.d/' Real source value: 'puppet:///files/php/conf.d/xdebug.ini'
This enables you to use the following:
php::module { [ "xdebug", "suhosin", ]:
source => "puppet:///files/php/conf.d/",
require => Apt::Sources_list["kwick-php53"],
notify => Class["php::fpm::service"],
}
The same as in 2. is valid.
For more informations, see EXAMPLE
You can define which services to notify by setting 'notify =>' on every resource. You are able to use a module, which will trigger a notify of apache, but not of fpm. Or no notify at all, because you are using this module only in CLI.
- php::apache2 requires apache module
- php::apache2 and php::fpm both install CLI version
- Manage FPM configuration (global settings)
- Test php::apache2, everything else should work
- Document the usage of php::fpm::pool