From 82446dddc48e650e814a1733c3301da95b533aad Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Sun, 28 Apr 2013 23:10:43 +0200 Subject: [PATCH 1/5] Decouple fastcgi config from webserver. --- manifests/config.pp | 4 +++- manifests/fpm/fastcgi.pp | 13 ++++--------- manifests/fpm/service.pp | 5 +---- manifests/fpm/webserver/apache.pp | 10 ++++++++++ manifests/fpm/webserver/nginx.pp | 16 ++++++++++++++++ 5 files changed, 34 insertions(+), 14 deletions(-) create mode 100644 manifests/fpm/webserver/apache.pp create mode 100644 manifests/fpm/webserver/nginx.pp diff --git a/manifests/config.pp b/manifests/config.pp index f8342a3..0dd88c7 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,6 +1,8 @@ # Base configuration values for PHP # -class php::config { +class php::config ( + $webserver = 'nginx', +) { require boxen::config $root = "${boxen::config::home}/phpenv" diff --git a/manifests/fpm/fastcgi.pp b/manifests/fpm/fastcgi.pp index fc8f651..dccd4cf 100644 --- a/manifests/fpm/fastcgi.pp +++ b/manifests/fpm/fastcgi.pp @@ -1,4 +1,4 @@ -# Adds FastCGI configuration parameters to Nginx which is +# Adds FastCGI configuration parameters to $webserver which is # required to use PHP-FPM # # Usage: @@ -6,11 +6,6 @@ # include php::fpm::fastcgi # class php::fpm::fastcgi { - require nginx::config - - file { "${nginx::config::configdir}/fastcgi_params": - source => 'puppet:///modules/php/nginx_fastcgi_params', - require => File[$nginx::config::configdir], - notify => Service['dev.nginx'], - } -} \ No newline at end of file + $webserver_class = "php::fpm::webserver::${php::config::webserver}" + include $webserver_class +} diff --git a/manifests/fpm/service.pp b/manifests/fpm/service.pp index 0d660a7..68bc539 100644 --- a/manifests/fpm/service.pp +++ b/manifests/fpm/service.pp @@ -11,9 +11,6 @@ $ensure = running, ) { require php::config - - # Set some nginx params to ensure that fastcgi actually works - include nginx::config include php::fpm::fastcgi # Config file locations @@ -41,7 +38,7 @@ service { "dev.php-fpm.${version}": ensure => running, subscribe => File["/Library/LaunchDaemons/dev.php-fpm.${version}.plist"], - require => File["${nginx::config::configdir}/fastcgi_params"], + require => Class['php::fpm::fastcgi'], } } else { diff --git a/manifests/fpm/webserver/apache.pp b/manifests/fpm/webserver/apache.pp new file mode 100644 index 0000000..e326145 --- /dev/null +++ b/manifests/fpm/webserver/apache.pp @@ -0,0 +1,10 @@ +# Adds FastCGI configuration parameters to Apache which is +# required to use PHP-FPM +# +# Usage: +# +# include php::fpm::webserver::apache +# +class php::fpm::webserver::apache { + # @todo configure apache +} \ No newline at end of file diff --git a/manifests/fpm/webserver/nginx.pp b/manifests/fpm/webserver/nginx.pp new file mode 100644 index 0000000..588a511 --- /dev/null +++ b/manifests/fpm/webserver/nginx.pp @@ -0,0 +1,16 @@ +# Adds FastCGI configuration parameters to Nginx which is +# required to use PHP-FPM +# +# Usage: +# +# include php::fpm::webserver::nginx +# +class php::fpm::webserver::nginx { + require nginx::config + + file { "${nginx::config::configdir}/fastcgi_params": + source => 'puppet:///modules/php/nginx_fastcgi_params', + require => File[$nginx::config::configdir], + notify => Service['dev.nginx'], + } +} \ No newline at end of file From 24f58ab80aa71c6fe089893028a1b3b81a76c9e7 Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Sun, 28 Apr 2013 23:34:10 +0200 Subject: [PATCH 2/5] Lint manifests/fpm/webserver/apache.pp --- manifests/fpm/webserver/apache.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/fpm/webserver/apache.pp b/manifests/fpm/webserver/apache.pp index e326145..0c42e9f 100644 --- a/manifests/fpm/webserver/apache.pp +++ b/manifests/fpm/webserver/apache.pp @@ -6,5 +6,5 @@ # include php::fpm::webserver::apache # class php::fpm::webserver::apache { - # @todo configure apache -} \ No newline at end of file + # @todo configure apache +} From 9ee06ec22710be196af62c30b908ad93bb58f461 Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Sun, 28 Apr 2013 23:34:46 +0200 Subject: [PATCH 3/5] Update librarian-puppet to version 0.9.9. --- Gemfile.lock | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 20f1cf3..0779a8e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,49 +1,49 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.3.2) + addressable (2.3.4) ansi (1.4.3) - boxen (1.0.0) + boxen (1.1.2) ansi (~> 1.4) hiera (~> 1.0.0) highline (~> 1.6) json_pure (>= 1.7.7, < 2.0) - librarian-puppet (~> 0.9) + librarian-puppet (~> 0.9.9) octokit (~> 1.15) puppet (~> 3.0) - cardboard (1.0.0) + cardboard (1.0.1) boxen (~> 1.0) puppet-lint (~> 0.3) puppetlabs_spec_helper (~> 0.4) rspec-puppet (~> 0.1) - diff-lcs (1.1.3) - facter (1.6.17) - faraday (0.8.5) + diff-lcs (1.2.4) + facter (1.7.0) + faraday (0.8.7) multipart-post (~> 1.1) faraday_middleware (0.9.0) faraday (>= 0.7.4, < 0.9) - hashie (1.2.0) + hashie (2.0.4) hiera (1.0.0) - highline (1.6.15) + highline (1.6.18) json (1.7.7) json_pure (1.7.7) - librarian-puppet (0.9.8) + librarian-puppet (0.9.9) json thor (~> 0.15) metaclass (0.0.1) - mocha (0.13.2) + mocha (0.13.3) metaclass (~> 0.0.1) - multi_json (1.6.0) - multipart-post (1.1.5) + multi_json (1.7.2) + multipart-post (1.2.0) netrc (0.7.7) - octokit (1.23.0) + octokit (1.24.0) addressable (~> 2.2) faraday (~> 0.8) faraday_middleware (~> 0.9) - hashie (~> 1.2) + hashie (~> 2.0) multi_json (~> 1.3) netrc (~> 0.7.7) - puppet (3.1.0) + puppet (3.1.1) facter (~> 1.6) hiera (~> 1.0) puppet-lint (0.3.2) @@ -52,18 +52,18 @@ GEM rake rspec (>= 2.9.0) rspec-puppet (>= 0.1.1) - rake (10.0.3) - rspec (2.12.0) - rspec-core (~> 2.12.0) - rspec-expectations (~> 2.12.0) - rspec-mocks (~> 2.12.0) - rspec-core (2.12.2) - rspec-expectations (2.12.1) - diff-lcs (~> 1.1.3) - rspec-mocks (2.12.2) + rake (10.0.4) + rspec (2.13.0) + rspec-core (~> 2.13.0) + rspec-expectations (~> 2.13.0) + rspec-mocks (~> 2.13.0) + rspec-core (2.13.1) + rspec-expectations (2.13.0) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.13.1) rspec-puppet (0.1.6) rspec - thor (0.17.0) + thor (0.18.1) PLATFORMS ruby From 0589725081c03606d7f1a64349e13dfb68863801 Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Wed, 1 May 2013 19:48:40 +0200 Subject: [PATCH 4/5] Require only if nginx is enabled. --- manifests/project.pp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/manifests/project.pp b/manifests/project.pp index 1ebcd94..505b27b 100644 --- a/manifests/project.pp +++ b/manifests/project.pp @@ -201,11 +201,19 @@ require => Repository[$repo_dir], } - # Spin up a PHP-FPM pool for this project, listening on an Nginx socket - php::fpm::pool { "${name}-${php}": - version => $php, - socket_path => "${boxen::config::socketdir}/${name}", - require => File["${nginx::config::sitesdir}/${name}.conf"], + if $nginx { + # Spin up a PHP-FPM pool for this project, listening on an Nginx socket + php::fpm::pool { "${name}-${php}": + version => $php, + socket_path => "${boxen::config::socketdir}/${name}", + require => File["${nginx::config::sitesdir}/${name}.conf"], + } + } + else { + php::fpm::pool { "${name}-${php}": + version => $php, + socket_path => "${boxen::config::socketdir}/${name}", + } } if $fpm_pool { From 53cd2979c0413a5a50c703debc1f2927d3aa7c52 Mon Sep 17 00:00:00 2001 From: Jens Jacobsen Date: Tue, 24 Sep 2013 11:54:59 +0200 Subject: [PATCH 5/5] Add php 5.4.18-20. --- manifests/5_4_18.pp | 8 ++++++++ manifests/5_4_19.pp | 8 ++++++++ manifests/5_4_20.pp | 8 ++++++++ manifests/fpm/5_4_18.pp | 10 ++++++++++ manifests/fpm/5_4_19.pp | 10 ++++++++++ manifests/fpm/5_4_20.pp | 10 ++++++++++ 6 files changed, 54 insertions(+) create mode 100644 manifests/5_4_18.pp create mode 100644 manifests/5_4_19.pp create mode 100644 manifests/5_4_20.pp create mode 100644 manifests/fpm/5_4_18.pp create mode 100644 manifests/fpm/5_4_19.pp create mode 100644 manifests/fpm/5_4_20.pp diff --git a/manifests/5_4_18.pp b/manifests/5_4_18.pp new file mode 100644 index 0000000..a73d35c --- /dev/null +++ b/manifests/5_4_18.pp @@ -0,0 +1,8 @@ +# Installs php 5.4.18 +# +# Usage: +# +# include php::5_4_18 +class php::5_4_18 { + php::version { '5.4.18': } +} diff --git a/manifests/5_4_19.pp b/manifests/5_4_19.pp new file mode 100644 index 0000000..ccab6f8 --- /dev/null +++ b/manifests/5_4_19.pp @@ -0,0 +1,8 @@ +# Installs php 5.4.19 +# +# Usage: +# +# include php::5_4_19 +class php::5_4_19 { + php::version { '5.4.19': } +} diff --git a/manifests/5_4_20.pp b/manifests/5_4_20.pp new file mode 100644 index 0000000..0c35640 --- /dev/null +++ b/manifests/5_4_20.pp @@ -0,0 +1,8 @@ +# Installs php 5.4.20 +# +# Usage: +# +# include php::5_4_20 +class php::5_4_20 { + php::version { '5.4.20': } +} diff --git a/manifests/fpm/5_4_18.pp b/manifests/fpm/5_4_18.pp new file mode 100644 index 0000000..5e92adb --- /dev/null +++ b/manifests/fpm/5_4_18.pp @@ -0,0 +1,10 @@ +# Launches a PHP FPM service running PHP 5.4.18 +# Installs PHP 5.4.18 if it doesn't already exist +# +# Usage: +# +# include php::fpm::5_4_18 +# +class php::fpm::5_4_18 { + php::fpm { '5.4.18': } +} diff --git a/manifests/fpm/5_4_19.pp b/manifests/fpm/5_4_19.pp new file mode 100644 index 0000000..42c3e91 --- /dev/null +++ b/manifests/fpm/5_4_19.pp @@ -0,0 +1,10 @@ +# Launches a PHP FPM service running PHP 5.4.19 +# Installs PHP 5.4.19 if it doesn't already exist +# +# Usage: +# +# include php::fpm::5_4_19 +# +class php::fpm::5_4_19 { + php::fpm { '5.4.19': } +} diff --git a/manifests/fpm/5_4_20.pp b/manifests/fpm/5_4_20.pp new file mode 100644 index 0000000..0951919 --- /dev/null +++ b/manifests/fpm/5_4_20.pp @@ -0,0 +1,10 @@ +# Launches a PHP FPM service running PHP 5.4.20 +# Installs PHP 5.4.20 if it doesn't already exist +# +# Usage: +# +# include php::fpm::5_4_20 +# +class php::fpm::5_4_20 { + php::fpm { '5.4.20': } +}