puppet-php icon indicating copy to clipboard operation
puppet-php copied to clipboard

Providers for FPM Pools etc

Open khaefeli opened this issue 11 years ago • 1 comments

Hi,

did you think about providers for FPM pools and other configurations?

Like they do:

https://forge.puppetlabs.com/puppetlabs/mysql#mysql_user https://forge.puppetlabs.com/jfryman/nginx (hiera support)

the advantage is, that everybody could easily create pools etc over hiera data without a "wrapper" module / modify this modules core.

(maybe I could create a PR)

cheers

khaefeli avatar Jun 02 '14 15:06 khaefeli

for the moment I've created the class "php::fpm" (fpm.pp) and autoloading the hiera data:

class php::fpm (

#set defaults that php::fpm:config is loaded
    $config                   = {},
    ) {

create_resources('php_fpm', $php::fpm::config)

define php_fpm(
    $listen,
    $user,
    ){

php::fpm::conf { $name:
    listen  => $listen,
    user    => $user,
    }
}
}

hiera data:

php::fpm::config:
   "pool1":
    "listen": "127.0.0.1:9001"
    "user": "www-data"
   "pool2":
    "listen": "127.0.0.1:9002"
    "user": "someuser"

khaefeli avatar Jun 03 '14 15:06 khaefeli