Update the mediawiki cookbook and upstream cookbooks

Compatibility with Chef 14
This commit is contained in:
Greg Karékinian
2019-04-08 11:20:12 +02:00
parent 6e3e8cde1b
commit 777b85c2ab
312 changed files with 5603 additions and 14219 deletions

View File

@@ -0,0 +1 @@
~FC015

View File

@@ -1,68 +1,67 @@
[![Build Status](https://travis-ci.org/yevgenko/cookbook-php-fpm.svg?branch=master)](https://travis-ci.org/yevgenko/cookbook-php-fpm)
Description
===========
# Description
Installs and configures PHP-FPM (FastCGI Process Manager), an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. It's like the `unicorn` of the PHP world dawg.
Installs and configures PHP-FPM (FastCGI Process Manager), an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. It's like the `unicorn` of the PHP world dawg.
Requirements
============
# Requirements
Platform
--------
## Platform
* Debian, Ubuntu
* CentOS, Red Hat, Fedora
* Amazon Linux
- Debian, Ubuntu
- CentOS, Red Hat, Fedora
- Amazon Linux
Cookbooks
---------
## Cookbooks
* apt (leverages apt_repository LWRP)
* yum (leverages yum_repository LWRP)
- none
The `apt_repository` and `yum_repository` LWRPs are used from these cookbooks to create the proper repository entries so the php-fpm package downloaded and installed.
## Chef
Description
==========
- 12.14 or later
Creates a PHP-FPM configuration file at the path specified. Meant to be deployed with a service init scheme/supervisor such as runit. Please see the `application::php-fpm` recipe for a complete working example. In depth information about PHP-FPM's configuration values can be [found in the PHP-FPM documentation](http://php.net/manual/en/install.fpm.configuration.php).
# Description
Usage
=====
Simply include the recipe where you want PHP-FPM installed. Default pool __www__ will be created. To disable pool creation set default['php-fpm']['pools'] to false.
Creates a PHP-FPM configuration file at the path specified. Meant to be deployed with a service init scheme/supervisor such as runit. Please see the `application::php-fpm` recipe for a complete working example. In depth information about PHP-FPM's configuration values can be [found in the PHP-FPM documentation](http://php.net/manual/en/install.fpm.configuration.php).
# Usage
Simply include the recipe where you want PHP-FPM installed. Default pool **www** will be created. To disable pool creation set default['php-fpm']['pools'] to false.
To customize settings and pools you can override default attributes.
### Usage in roles:
## Usage in roles:
```ruby
name "php-fpm"
description "php fpm role"
run_list "recipe[php-fpm]"
override_attributes "php-fpm" => {
"pools" => {
"default" => {
:enable => true
},
"www" => {
:enable => "true",
:cookbook => "another-cookbook",
:process_manager => "dynamic",
:max_requests => 5000,
:php_options => { 'php_admin_flag[log_errors]' => 'on', 'php_admin_value[memory_limit]' => '32M' }
}
}
"pools" => {
"default" => {
:enable => true
},
"www" => {
:enable => "true",
:cookbook => "another-cookbook",
:process_manager => "dynamic",
:max_requests => 5000,
:php_options => { 'php_admin_flag[log_errors]' => 'on', 'php_admin_value[memory_limit]' => '32M' }
}
}
}
```
Creating pools in recipes
=========================
### Create PHP-FPM pool named 'www' with default settings:
# Creating pools in recipes
## Create PHP-FPM pool named 'www' with default settings:
```ruby
php_fpm_pool "www"
```
### Create PHP-FPM pool named 'www' with custom settings:
## Create PHP-FPM pool named 'www' with custom settings:
```ruby
php_fpm_pool "www" do
cookbook "another-cookbook" # get template from another cookbook
@@ -72,21 +71,21 @@ php_fpm_pool "www" do
end
```
### Delete PHP-FPM pool named 'www':
## Delete PHP-FPM pool named 'www':
```ruby
php_fpm_pool "www" do
enable false
end
```
Development
===========
# Development
### Requirements
## Requirements
* [Docker](https://www.docker.com/)
- [Docker](https://www.docker.com/)
### Setup
## Setup
To get all dependencies:
@@ -94,7 +93,7 @@ To get all dependencies:
bundle install
```
### Test
## Test
To see available platforms:
@@ -114,7 +113,7 @@ To test all platforms:
bundle exec rake kitchen:all
```
### Publishing (maintainers only!)
## Publishing (maintainers only!)
Bump version in metadata.rb, commit and push to master!
@@ -122,29 +121,22 @@ Bump version in metadata.rb, commit and push to master!
bundle exec rake publish
```
as a result new tag will be created and pushed to github as well as new version
will be published on https://supermarket.chef.io
as a result new tag will be created and pushed to github as well as new version will be published on <https://supermarket.chef.io>
Contributing
===========
# Contributing
Please do not bump version when proposing a change, no other rules ;)
License and Author
==================
# License and Author
Author:: Seth Chisamore (<schisamo@opscode.com>)
Author:: Seth Chisamore ([schisamo@chef.io](mailto:schisamo@chef.io))
Copyright:: 2011, Opscode, Inc
Copyright:: 2011-2017, Chef Software, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
```
http://www.apache.org/licenses/LICENSE-2.0
```
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

View File

@@ -1,29 +1,25 @@
case node["platform_family"]
when "rhel", "fedora"
user = "apache"
group = "apache"
conf_dir = "/etc/php.d"
pool_conf_dir = "/etc/php-fpm.d"
conf_file = "/etc/php-fpm.conf"
error_log = "/var/log/php-fpm/error.log"
pid = "/var/run/php-fpm/php-fpm.pid"
case node['platform_family']
when 'rhel', 'fedora'
user = 'apache'
group = 'apache'
conf_dir = '/etc/php.d'
pool_conf_dir = '/etc/php-fpm.d'
conf_file = '/etc/php-fpm.conf'
error_log = '/var/log/php-fpm/error.log'
pid = '/var/run/php-fpm/php-fpm.pid'
else
user = "www-data"
group = "www-data"
if platform?('ubuntu') and node['platform_version'].to_f >= 16.04
php_conf_dir = "/etc/php/7.0"
php_fpm_name = "php7.0-fpm"
user = 'www-data'
group = 'www-data'
if platform?('ubuntu') && node['platform_version'].to_f >= 16.04
php_conf_dir = '/etc/php/7.0'
php_fpm_name = 'php7.0-fpm'
else
php_conf_dir = "/etc/php5"
php_fpm_name = "php5-fpm"
php_conf_dir = '/etc/php5'
php_fpm_name = 'php5-fpm'
end
conf_dir = "#{php_conf_dir}/fpm/conf.d"
pool_conf_dir = "#{php_conf_dir}/fpm/pool.d"
if node['platform'] == "ubuntu" and node['platform_version'].to_f <= 10.04
conf_file = "#{php_conf_dir}/fpm/php5-fpm.conf"
else
conf_file = "#{php_conf_dir}/fpm/php-fpm.conf"
end
conf_file = "#{php_conf_dir}/fpm/php-fpm.conf"
error_log = "/var/log/#{php_fpm_name}.log"
pid = "/var/run/#{php_fpm_name}.pid"
end
@@ -36,7 +32,7 @@ default['php-fpm']['conf_file'] = conf_file
default['php-fpm']['pid'] = pid
default['php-fpm']['log_dir'] = '/var/log/php-fpm'
default['php-fpm']['error_log'] = error_log
default['php-fpm']['log_level'] = "notice"
default['php-fpm']['log_level'] = 'notice'
default['php-fpm']['emergency_restart_threshold'] = 0
default['php-fpm']['emergency_restart_interval'] = 0
default['php-fpm']['process_control_timeout'] = 0
@@ -50,26 +46,26 @@ default['php-fpm']['request_terminate_timeout'] = 0
default['php-fpm']['catch_workers_output'] = 'no'
default['php-fpm']['security_limit_extensions'] = '.php'
default['php-fpm']['listen_mode'] = '0660'
default['php-fpm']['listen'] = "/var/run/php-fpm-%{pool_name}.sock"
default['php-fpm']['listen'] = '/var/run/php-fpm-%{pool_name}.sock'
default['php-fpm']['pools'] = {
"www" => {
:enable => true
}
'www' => {
enable: true,
},
}
default['php-fpm']['skip_repository_install'] = false
default['php-fpm']['installation_action'] = :install
default['php-fpm']['version'] = nil
case node["platform_family"]
when "rhel"
default['php-fpm']['yum_url'] = "http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/"
default['php-fpm']['yum_mirrorlist'] = "http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror"
when "fedora"
case node['platform_family']
when 'rhel'
default['php-fpm']['yum_url'] = 'http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/'
default['php-fpm']['yum_mirrorlist'] = 'http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror'
when 'fedora'
default['php-fpm']['skip_repository_install'] = true
end
default['php-fpm']['dotdeb_repository']['uri'] = "http://packages.dotdeb.org"
default['php-fpm']['dotdeb_repository']['key'] = "http://www.dotdeb.org/dotdeb.gpg"
default['php-fpm']['dotdeb-php53_repository']['uri'] = "http://php53.dotdeb.org"
default['php-fpm']['dotdeb_repository']['uri'] = 'http://packages.dotdeb.org'
default['php-fpm']['dotdeb_repository']['key'] = 'http://www.dotdeb.org/dotdeb.gpg'
default['php-fpm']['dotdeb-php53_repository']['uri'] = 'http://php53.dotdeb.org'

View File

@@ -2,7 +2,7 @@
# Cookbook Name:: php-fpm
# Definition:: php_fpm_pool
#
# Copyright 2008-2009, Opscode, Inc.
# Copyright 2008-2017, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,8 +17,7 @@
# limitations under the License.
#
define :php_fpm_pool, :template => "pool.conf.erb", :enable => true do
define :php_fpm_pool, template: 'pool.conf.erb', enable: true do
pool_name = params[:name]
conf_file = "#{node['php-fpm']['pool_conf_dir']}/#{pool_name}.conf"
@@ -27,40 +26,40 @@ define :php_fpm_pool, :template => "pool.conf.erb", :enable => true do
template conf_file do
only_if "test -d #{node['php-fpm']['pool_conf_dir']} || mkdir -p #{node['php-fpm']['pool_conf_dir']}"
source params[:template]
owner "root"
group "root"
mode 00644
cookbook params[:cookbook] || "php-fpm"
owner 'root'
group 'root'
mode '0644'
cookbook params[:cookbook] || 'php-fpm'
variables(
:pool_name => pool_name,
:listen => params[:listen] || node['php-fpm']['listen'].gsub(%r[%{pool_name}], pool_name),
:listen_owner => params[:listen_owner] || node['php-fpm']['listen_owner'] || node['php-fpm']['user'],
:listen_group => params[:listen_group] || node['php-fpm']['listen_group'] || node['php-fpm']['group'],
:listen_mode => params[:listen_mode] || node['php-fpm']['listen_mode'],
:allowed_clients => params[:allowed_clients],
:user => params[:user] || node['php-fpm']['user'],
:group => params[:group] || node['php-fpm']['group'],
:process_manager => params[:process_manager] || node['php-fpm']['process_manager'],
:max_children => params[:max_children] || node['php-fpm']['max_children'],
:start_servers => params[:start_servers] || node['php-fpm']['start_servers'],
:min_spare_servers => params[:min_spare_servers] || node['php-fpm']['min_spare_servers'],
:max_spare_servers => params[:max_spare_servers] || node['php-fpm']['max_spare_servers'],
:max_requests => params[:max_requests] || node['php-fpm']['max_requests'],
:catch_workers_output => params[:catch_workers_output] || node['php-fpm']['catch_workers_output'],
:security_limit_extensions => params[:security_limit_extensions] || node['php-fpm']['security_limit_extensions'],
:access_log => params[:access_log] || false,
:slowlog => params[:slowlog] || false,
:request_slowlog_timeout => params[:request_slowlog_timeout] || false,
:php_options => params[:php_options] || {},
:request_terminate_timeout => params[:request_terminate_timeout] || node['php-fpm']['request_terminate_timeout'],
:params => params
pool_name: pool_name,
listen: params[:listen] || node['php-fpm']['listen'].gsub(/%{pool_name}/, pool_name),
listen_owner: params[:listen_owner] || node['php-fpm']['listen_owner'] || node['php-fpm']['user'],
listen_group: params[:listen_group] || node['php-fpm']['listen_group'] || node['php-fpm']['group'],
listen_mode: params[:listen_mode] || node['php-fpm']['listen_mode'],
allowed_clients: params[:allowed_clients],
user: params[:user] || node['php-fpm']['user'],
group: params[:group] || node['php-fpm']['group'],
process_manager: params[:process_manager] || node['php-fpm']['process_manager'],
max_children: params[:max_children] || node['php-fpm']['max_children'],
start_servers: params[:start_servers] || node['php-fpm']['start_servers'],
min_spare_servers: params[:min_spare_servers] || node['php-fpm']['min_spare_servers'],
max_spare_servers: params[:max_spare_servers] || node['php-fpm']['max_spare_servers'],
max_requests: params[:max_requests] || node['php-fpm']['max_requests'],
catch_workers_output: params[:catch_workers_output] || node['php-fpm']['catch_workers_output'],
security_limit_extensions: params[:security_limit_extensions] || node['php-fpm']['security_limit_extensions'],
access_log: params[:access_log] || false,
slowlog: params[:slowlog] || false,
request_slowlog_timeout: params[:request_slowlog_timeout] || false,
php_options: params[:php_options] || {},
request_terminate_timeout: params[:request_terminate_timeout] || node['php-fpm']['request_terminate_timeout'],
params: params
)
notifies :restart, "service[php-fpm]"
notifies :restart, 'service[php-fpm]'
end
else
cookbook_file conf_file do
action :delete
notifies :restart, "service[php-fpm]"
notifies :restart, 'service[php-fpm]'
end
end
end

View File

@@ -1,37 +1 @@
{
"name": "php-fpm",
"version": "0.7.9",
"description": "Installs/Configures php-fpm",
"long_description": "[![Build Status](https://travis-ci.org/yevgenko/cookbook-php-fpm.svg?branch=master)](https://travis-ci.org/yevgenko/cookbook-php-fpm)\n\nDescription\n===========\n\nInstalls and configures PHP-FPM (FastCGI Process Manager), an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. It's like the `unicorn` of the PHP world dawg.\n\nRequirements\n============\n\nPlatform\n--------\n\n* Debian, Ubuntu\n* CentOS, Red Hat, Fedora\n* Amazon Linux\n\nCookbooks\n---------\n\n* apt (leverages apt_repository LWRP)\n* yum (leverages yum_repository LWRP)\n\nThe `apt_repository` and `yum_repository` LWRPs are used from these cookbooks to create the proper repository entries so the php-fpm package downloaded and installed.\n\nDescription\n==========\n\nCreates a PHP-FPM configuration file at the path specified. Meant to be deployed with a service init scheme/supervisor such as runit. Please see the `application::php-fpm` recipe for a complete working example. In depth information about PHP-FPM's configuration values can be [found in the PHP-FPM documentation](http://php.net/manual/en/install.fpm.configuration.php).\n\nUsage\n=====\nSimply include the recipe where you want PHP-FPM installed. Default pool __www__ will be created. To disable pool creation set default['php-fpm']['pools'] to false.\n\nTo customize settings and pools you can override default attributes.\n\n### Usage in roles:\n```ruby\nname \"php-fpm\"\ndescription \"php fpm role\"\nrun_list \"recipe[php-fpm]\"\noverride_attributes \"php-fpm\" => {\n\t\"pools\" => {\n\t\t\"default\" => {\n\t\t\t:enable => true\n\t\t},\n\t\t\"www\" => {\n\t\t\t:enable => \"true\",\n\t\t\t:cookbook => \"another-cookbook\",\n\t\t\t:process_manager => \"dynamic\",\n\t\t\t:max_requests => 5000,\n\t\t\t:php_options => { 'php_admin_flag[log_errors]' => 'on', 'php_admin_value[memory_limit]' => '32M' }\n\t\t}\n\t}\n}\n```\n\nCreating pools in recipes\n=========================\n### Create PHP-FPM pool named 'www' with default settings:\n```ruby\nphp_fpm_pool \"www\"\n```\n\n### Create PHP-FPM pool named 'www' with custom settings:\n```ruby\nphp_fpm_pool \"www\" do\n cookbook \"another-cookbook\" # get template from another cookbook\n process_manager \"dynamic\"\n max_requests 5000\n php_options 'php_admin_flag[log_errors]' => 'on', 'php_admin_value[memory_limit]' => '32M'\nend\n```\n\n### Delete PHP-FPM pool named 'www':\n```ruby\nphp_fpm_pool \"www\" do\n enable false\nend\n```\n\nDevelopment\n===========\n\n### Requirements\n\n* [Docker](https://www.docker.com/)\n\n### Setup\n\nTo get all dependencies:\n\n```\nbundle install\n```\n\n### Test\n\nTo see available platforms:\n\n```\nbundle exec rake -T\n```\n\nTo test particular platform:\n\n```\nbundle exec rake kitchen:default-ubuntu-1604\n```\n\nTo test all platforms:\n\n```\nbundle exec rake kitchen:all\n```\n\n### Publishing (maintainers only!)\n\nBump version in metadata.rb, commit and push to master!\n\n```\nbundle exec rake publish\n```\n\nas a result new tag will be created and pushed to github as well as new version\nwill be published on https://supermarket.chef.io\n\nContributing\n===========\n\nPlease do not bump version when proposing a change, no other rules ;)\n\nLicense and Author\n==================\n\nAuthor:: Seth Chisamore (<schisamo@opscode.com>)\n\nCopyright:: 2011, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
"maintainer": "Opscode, Inc.",
"maintainer_email": "cookbooks@opscode.com",
"license": "Apache 2.0",
"platforms": {
"debian": ">= 0.0.0",
"ubuntu": ">= 0.0.0",
"centos": ">= 0.0.0",
"redhat": ">= 0.0.0",
"fedora": ">= 0.0.0",
"amazon": ">= 0.0.0"
},
"dependencies": {
"apt": ">= 0.0.0",
"yum": ">= 3.0"
},
"recommendations": {
},
"suggestions": {
},
"conflicting": {
},
"providing": {
},
"replacing": {
},
"attributes": {
},
"groupings": {
},
"recipes": {
}
}
{"name":"php-fpm","version":"0.8.0","description":"Installs/Configures php-fpm","long_description":"[![Build Status](https://travis-ci.org/yevgenko/cookbook-php-fpm.svg?branch=master)](https://travis-ci.org/yevgenko/cookbook-php-fpm)\n\n# Description\n\nInstalls and configures PHP-FPM (FastCGI Process Manager), an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites. It's like the `unicorn` of the PHP world dawg.\n\n# Requirements\n\n## Platform\n\n- Debian, Ubuntu\n- CentOS, Red Hat, Fedora\n- Amazon Linux\n\n## Cookbooks\n\n- none\n\n## Chef\n\n- 12.14 or later\n\n# Description\n\nCreates a PHP-FPM configuration file at the path specified. Meant to be deployed with a service init scheme/supervisor such as runit. Please see the `application::php-fpm` recipe for a complete working example. In depth information about PHP-FPM's configuration values can be [found in the PHP-FPM documentation](http://php.net/manual/en/install.fpm.configuration.php).\n\n# Usage\n\nSimply include the recipe where you want PHP-FPM installed. Default pool **www** will be created. To disable pool creation set default['php-fpm']['pools'] to false.\n\nTo customize settings and pools you can override default attributes.\n\n## Usage in roles:\n\n```ruby\nname \"php-fpm\"\ndescription \"php fpm role\"\nrun_list \"recipe[php-fpm]\"\noverride_attributes \"php-fpm\" => {\n \"pools\" => {\n \"default\" => {\n :enable => true\n },\n \"www\" => {\n :enable => \"true\",\n :cookbook => \"another-cookbook\",\n :process_manager => \"dynamic\",\n :max_requests => 5000,\n :php_options => { 'php_admin_flag[log_errors]' => 'on', 'php_admin_value[memory_limit]' => '32M' }\n }\n }\n}\n```\n\n# Creating pools in recipes\n\n## Create PHP-FPM pool named 'www' with default settings:\n\n```ruby\nphp_fpm_pool \"www\"\n```\n\n## Create PHP-FPM pool named 'www' with custom settings:\n\n```ruby\nphp_fpm_pool \"www\" do\n cookbook \"another-cookbook\" # get template from another cookbook\n process_manager \"dynamic\"\n max_requests 5000\n php_options 'php_admin_flag[log_errors]' => 'on', 'php_admin_value[memory_limit]' => '32M'\nend\n```\n\n## Delete PHP-FPM pool named 'www':\n\n```ruby\nphp_fpm_pool \"www\" do\n enable false\nend\n```\n\n# Development\n\n## Requirements\n\n- [Docker](https://www.docker.com/)\n\n## Setup\n\nTo get all dependencies:\n\n```\nbundle install\n```\n\n## Test\n\nTo see available platforms:\n\n```\nbundle exec rake -T\n```\n\nTo test particular platform:\n\n```\nbundle exec rake kitchen:default-ubuntu-1604\n```\n\nTo test all platforms:\n\n```\nbundle exec rake kitchen:all\n```\n\n## Publishing (maintainers only!)\n\nBump version in metadata.rb, commit and push to master!\n\n```\nbundle exec rake publish\n```\n\nas a result new tag will be created and pushed to github as well as new version will be published on <https://supermarket.chef.io>\n\n# Contributing\n\nPlease do not bump version when proposing a change, no other rules ;)\n\n# License and Author\n\nAuthor:: Seth Chisamore ([schisamo@chef.io](mailto:schisamo@chef.io))\n\nCopyright:: 2011-2017, Chef Software, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\n```\nhttp://www.apache.org/licenses/LICENSE-2.0\n```\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache-2.0","platforms":{"debian":">= 0.0.0","ubuntu":">= 0.0.0","centos":">= 0.0.0","redhat":">= 0.0.0","fedora":">= 0.0.0","amazon":">= 0.0.0","oracle":">= 0.0.0","scientific":">= 0.0.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/yevgenko/cookbook-php-fpm","issues_url":"https://github.com/yevgenko/cookbook-php-fpm/issues","chef_version":[[">= 12.14"]],"ohai_version":[]}

View File

@@ -1,9 +1,9 @@
#
# Author:: Seth Chisamore (<schisamo@opscode.com>)
# Author:: Seth Chisamore (<schisamo@chef.io>)
# Cookbook Name:: php-fpm
# Recipe:: package
#
# Copyright 2011, Opscode, Inc.
# Copyright 2011-2017, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,11 +19,11 @@
#
template node['php-fpm']['conf_file'] do
source "php-fpm.conf.erb"
source 'php-fpm.conf.erb'
mode 00644
owner "root"
group "root"
notifies :restart, "service[php-fpm]"
owner 'root'
group 'root'
notifies :restart, 'service[php-fpm]'
end
if node['php-fpm']['pools']
@@ -36,7 +36,7 @@ if node['php-fpm']['pools']
end
php_fpm_pool pool_name do
pool.each do |k, v|
self.params[k.to_sym] = v
params[k.to_sym] = v
end
end
end

View File

@@ -3,7 +3,7 @@
# Cookbook Name:: php-fpm
# Recipe:: default
#
# Copyright 2011, Opscode, Inc.
# Copyright 2011-2017, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@@ -3,7 +3,7 @@
# Cookbook Name:: php-fpm
# Recipe:: package
#
# Copyright 2011, Opscode, Inc.
# Copyright 2011-2017, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,42 +19,41 @@
#
include_recipe 'php-fpm::repository' unless node['php-fpm']['skip_repository_install']
include_recipe 'apt::default' if node['platform_family'] == 'debian'
if node['php-fpm']['package_name'].nil?
if platform_family?("rhel", "fedora")
php_fpm_package_name = "php-fpm"
elsif platform?('ubuntu') and node['platform_version'].to_f >= 16.04
php_fpm_package_name = "php7.0-fpm"
else
php_fpm_package_name = "php5-fpm"
end
else
php_fpm_package_name = node['php-fpm']['package_name']
end
php_fpm_package_name = if node['php-fpm']['package_name'].nil?
if platform_family?('rhel', 'fedora')
'php-fpm'
elsif platform?('ubuntu') && node['platform_version'].to_f >= 16.04
'php7.0-fpm'
else
'php5-fpm'
end
else
node['php-fpm']['package_name']
end
package php_fpm_package_name do
action node['php-fpm']['installation_action']
version node['php-fpm']['version'] if node['php-fpm']['version']
end
if node['php-fpm']['service_name'].nil?
php_fpm_service_name = php_fpm_package_name
else
php_fpm_service_name = node['php-fpm']['service_name']
end
php_fpm_service_name = if node['php-fpm']['service_name'].nil?
php_fpm_package_name
else
node['php-fpm']['service_name']
end
service_provider = nil
# this is actually already done in chef, but is kept here for older chef releases
if platform?('ubuntu') and node['platform_version'].to_f.between?(13.10, 14.10)
if platform?('ubuntu') && node['platform_version'].to_f.between?(13.10, 14.10)
service_provider = ::Chef::Provider::Service::Upstart
end
directory node['php-fpm']['log_dir']
service "php-fpm" do
service 'php-fpm' do
provider service_provider if service_provider
service_name php_fpm_service_name
supports :start => true, :stop => true, :restart => true, :reload => true
action [ :enable, :start ]
supports start: true, stop: true, restart: true, reload: true
action [:enable, :start]
end

View File

@@ -3,7 +3,7 @@
# Cookbook Name:: php-fpm
# Recipe:: package
#
# Copyright 2011, Opscode, Inc.
# Copyright 2011-2017, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,68 +19,30 @@
#
case node['platform']
when 'ubuntu'
if node['platform_version'].to_f <= 10.04
# Configure Brian's PPA
# We'll install php5-fpm from the Brian's PPA backports
apt_repository "brianmercer-php" do
uri "http://ppa.launchpad.net/brianmercer/php/ubuntu"
distribution node['lsb']['codename']
components ["main"]
keyserver "keyserver.ubuntu.com"
key "8D0DC64F"
action :add
end
# FIXME: apt-get update didn't trigger in above
execute "apt-get update"
end
when 'debian'
# Configure Dotdeb repos
# TODO: move this to it's own 'dotdeb' cookbook?
# http://www.dotdeb.org/instructions/
if node['platform_version'].to_f >= 8.0
apt_repository "dotdeb" do
apt_repository 'dotdeb' do
uri node['php-fpm']['dotdeb_repository']['uri']
distribution "jessie"
distribution 'jessie'
components ['all']
key node['php-fpm']['dotdeb_repository']['key']
action :add
end
elsif node['platform_version'].to_f >= 7.0
apt_repository "dotdeb" do
apt_repository 'dotdeb' do
uri node['php-fpm']['dotdeb_repository']['uri']
distribution "wheezy"
components ['all']
key node['php-fpm']['dotdeb_repository']['key']
action :add
end
elsif node['platform_version'].to_f >= 6.0
apt_repository "dotdeb" do
uri node['php-fpm']['dotdeb_repository']['uri']
distribution "squeeze"
components ['all']
key node['php-fpm']['dotdeb_repository']['key']
action :add
end
else
apt_repository "dotdeb" do
uri node['php-fpm']['dotdeb_repository']['uri']
distribution "oldstable"
components ['all']
key node['php-fpm']['dotdeb_repository']['key']
action :add
end
apt_repository "dotdeb-php53" do
uri node['php-fpm']['dotdeb-php53_repository']['uri']
distribution "oldstable"
distribution 'wheezy'
components ['all']
key node['php-fpm']['dotdeb_repository']['key']
action :add
end
end
when 'amazon', 'fedora', 'centos', 'redhat'
unless platform?('centos', 'redhat') && node['platform_version'].to_f >= 6.4
when 'amazon', 'fedora', 'centos', 'redhat', 'scientific', 'oracle'
unless platform?('centos', 'redhat') && node['platform_version'].to_f >= 6.4 # ~FC024
yum_repository 'remi' do
description 'Remi'
url node['php-fpm']['yum_url']