Skip to content

Commit

Permalink
Add the ability to specify a custom template file for the main FPM co…
Browse files Browse the repository at this point in the history
…nfig file
  • Loading branch information
timmooney committed Oct 20, 2014
1 parent 37f2979 commit 7bf317e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ class { 'phpfpm':
phpfpm::pool { 'main': }
```

Use a custom template file, which you must provide, to generate the main
FPM configuration file:

```puppet
class { 'phpfpm':
config_template_file => 'site/phpfpm/my-php-fpm.conf.erb',
}
```

Add a few custom pools with advanced options:

```puppet
Expand Down
3 changes: 2 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$service_name = $phpfpm::params::service_name,
$config_dir = $phpfpm::params::config_dir,
$config_name = $phpfpm::params::config_name,
$config_template_file = $phpfpm::params::config_template_file,
$pool_dir = $phpfpm::params::pool_dir,
$pid_file = $phpfpm::params::pid_file,
$error_log = $phpfpm::params::error_log,
Expand Down Expand Up @@ -70,7 +71,7 @@
# Main php-fpm config file
file { "${config_dir}/${config_name}":
ensure => 'present',
content => template('phpfpm/php-fpm.conf.erb'),
content => template($config_template_file),
notify => Class['phpfpm::service'],
}
}
Expand Down
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
$service_name = 'php5-fpm'
$config_dir = '/etc/php5/fpm'
$config_name = 'php-fpm.conf'
$config_template_file = 'phpfpm/php-fpm.conf.erb'
$pool_dir = '/etc/php5/fpm/pool.d'
$pid_file = '/var/run/php5-fpm.pid'
$error_log = '/var/log/php5-fpm.log'
Expand Down Expand Up @@ -76,6 +77,7 @@
$service_name = 'php-fpm'
$config_dir = '/etc/php'
$config_name = 'php-fpm.conf'
$config_template_file = 'phpfpm/php-fpm.conf.erb'
$pool_dir = '/etc/php/fpm.d'
$pid_file = '/run/php-fpm/php-fpm.pid'
$error_log = '/var/log/php-fpm.log'
Expand Down Expand Up @@ -137,6 +139,7 @@
$service_name = 'php-fpm'
$config_dir = '/etc/'
$config_name = 'php-fpm.conf'
$config_template_file = 'phpfpm/php-fpm.conf.erb'
$pool_dir = '/etc/php-fpm.d/'
$pid_file = '/var/run/php-fpm/php-fpm.pid'
$error_log = '/var/log/php-fpm/error.log'
Expand Down

0 comments on commit 7bf317e

Please sign in to comment.