Update more cookbooks

This commit is contained in:
Greg Karékinian 2017-06-16 11:25:49 +02:00
parent 7da2c5a738
commit f5858319a7
129 changed files with 1095 additions and 101571 deletions

50
Batali
View File

@ -9,32 +9,34 @@ Batali.define do
cookbook 'wordpress', cookbook 'wordpress',
git: 'https://github.com/67P/wordpress-cookbook.git', git: 'https://github.com/67P/wordpress-cookbook.git',
ref: 'relax_dependencies' ref: 'relax_dependencies'
cookbook 'postfix'
cookbook 'php-fpm', '0.7.8'
cookbook 'php', '~> 3.0.0'
cookbook 'poise-ruby-build', '~> 1.1.0'
cookbook 'application', '~> 5.2.0'
cookbook 'application_javascript'
cookbook 'application_ruby', '~> 4.1.0'
cookbook 'application_git', '~> 1.1.0' # 1.2.0 doesn't work with knife-solo
cookbook 'users', '~> 5.0.0'
cookbook 'sudo', '~> 3.5.0'
cookbook 'hostname'
cookbook 'redis', cookbook 'redis',
git: 'https://github.com/phlipper/chef-redis.git', git: 'https://github.com/phlipper/chef-redis.git',
ref: 'v0.5.6' ref: 'v0.5.6'
cookbook 'firewall', '~> 2.6.1' cookbook 'postfix', '~> 5.0.2'
cookbook 'chef_nginx', '~> 6.0.2' cookbook 'php-fpm', '~> 0.7.9'
cookbook 'build-essential' cookbook 'php', '~> 4.2.0'
cookbook 'mysql' cookbook 'poise-ruby-build', '~> 1.1.0'
cookbook 'postgresql', '~> 6.1' cookbook 'application', '~> 5.2.0'
cookbook 'application_javascript', '~> 1.0.0'
cookbook 'application_ruby', '~> 4.1.0'
cookbook 'application_git', '~> 1.1.0' # 1.2.0 doesn't work with knife-solo
cookbook 'users', '~> 5.0.0'
cookbook 'sudo', '~> 3.5.0'
cookbook 'hostname', '~> 0.4.2'
cookbook 'firewall', '~> 2.6.2'
cookbook 'chef_nginx', '~> 6.1.1'
cookbook 'build-essential', '~> 8.0.3'
cookbook 'mysql', '~> 8.4.0'
cookbook 'postgresql', '~> 6.1.1'
# Deprecated, but wordpress and mediawiki depend on it and it would painful
# to change it without moving the databases
cookbook 'database' cookbook 'database'
cookbook 'mysql2_chef_gem' cookbook 'mysql2_chef_gem', '~> 2.0.1'
cookbook 'chef_client_updater', '~> 1.0.2' cookbook 'chef_client_updater', '~> 1.1.1'
cookbook 'timezone-ii' cookbook 'timezone-ii', '~> 0.2.0'
cookbook 'nodejs', '~> 3.0.0' cookbook 'nodejs', '~> 3.0.0'
cookbook 'ark', '~> 3.0.0' cookbook 'ark', '~> 3.1.0'
cookbook 'logrotate', '~> 2.1.0' cookbook 'logrotate', '~> 2.2.0'
cookbook 'openssl', '~> 7.0.1' cookbook 'openssl', '~> 7.1.0'
cookbook 'ntp' cookbook 'ntp', '~> 3.4.0'
end end

View File

@ -71,21 +71,13 @@
[ [
"yum-epel", "yum-epel",
">= 0.0.0" ">= 0.0.0"
],
[
"iis",
">= 0.0.0"
],
[
"windows",
">= 0.0.0"
] ]
], ],
"version": "3.0.0", "version": "4.2.0",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/php/versions/3.0.0/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/php/versions/4.2.0/download",
"version": "3.0.0" "version": "4.2.0"
} }
}, },
{ {
@ -100,11 +92,11 @@
">= 1.1" ">= 1.1"
] ]
], ],
"version": "8.0.1", "version": "8.0.3",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/build-essential/versions/8.0.1/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/build-essential/versions/8.0.3/download",
"version": "8.0.1" "version": "8.0.3"
} }
}, },
{ {
@ -200,11 +192,11 @@
"dependencies": [ "dependencies": [
], ],
"version": "8.3.0", "version": "8.4.0",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/mysql/versions/8.3.0/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/mysql/versions/8.4.0/download",
"version": "8.3.0" "version": "8.4.0"
} }
}, },
{ {
@ -234,21 +226,6 @@
"version": "3.13.0" "version": "3.13.0"
} }
}, },
{
"name": "iis",
"dependencies": [
[
"windows",
">= 1.34.6"
]
],
"version": "5.0.8",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/iis/versions/5.0.8/download",
"version": "5.0.8"
}
},
{ {
"name": "database", "name": "database",
"dependencies": [ "dependencies": [
@ -299,18 +276,6 @@
"version": "12.19.0" "version": "12.19.0"
} }
}, },
{
"name": "openssl",
"dependencies": [
],
"version": "7.0.1",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/openssl/versions/7.0.1/download",
"version": "7.0.1"
}
},
{ {
"name": "chef_nginx", "name": "chef_nginx",
"dependencies": [ "dependencies": [
@ -335,11 +300,11 @@
">= 0.0.0" ">= 0.0.0"
] ]
], ],
"version": "6.0.2", "version": "6.1.1",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/chef_nginx/versions/6.0.2/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/chef_nginx/versions/6.1.1/download",
"version": "6.0.2" "version": "6.1.1"
} }
}, },
{ {
@ -436,11 +401,11 @@
">= 3.0" ">= 3.0"
] ]
], ],
"version": "0.7.8", "version": "0.7.9",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/php-fpm/versions/0.7.8/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/php-fpm/versions/0.7.9/download",
"version": "0.7.8" "version": "0.7.9"
} }
}, },
{ {
@ -503,6 +468,21 @@
"subdirectory": null "subdirectory": null
} }
}, },
{
"name": "iis",
"dependencies": [
[
"windows",
">= 1.34.6"
]
],
"version": "5.0.8",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/iis/versions/5.0.8/download",
"version": "5.0.8"
}
},
{ {
"name": "tar", "name": "tar",
"dependencies": [ "dependencies": [
@ -527,16 +507,32 @@
"version": "0.9.0" "version": "0.9.0"
} }
}, },
{
"name": "redis",
"dependencies": [
[
"apt",
"> 0"
]
],
"version": "0.5.6",
"source": {
"url": "https://github.com/phlipper/chef-redis.git",
"ref": "7476279fc9c8727f082b8d77b5e1922dc2ef437b",
"type": "Batali::Source::Git",
"subdirectory": null
}
},
{ {
"name": "postfix", "name": "postfix",
"dependencies": [ "dependencies": [
], ],
"version": "5.0.1", "version": "5.0.2",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/postfix/versions/5.0.1/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/postfix/versions/5.0.2/download",
"version": "5.0.1" "version": "5.0.2"
} }
}, },
{ {
@ -862,11 +858,11 @@
">= 0.0.0" ">= 0.0.0"
] ]
], ],
"version": "0.4.0", "version": "0.4.2",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/hostname/versions/0.4.0/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/hostname/versions/0.4.2/download",
"version": "0.4.0" "version": "0.4.2"
} }
}, },
{ {
@ -881,22 +877,6 @@
"version": "2.4.5" "version": "2.4.5"
} }
}, },
{
"name": "redis",
"dependencies": [
[
"apt",
"> 0"
]
],
"version": "0.5.6",
"source": {
"url": "https://github.com/phlipper/chef-redis.git",
"ref": "7476279fc9c8727f082b8d77b5e1922dc2ef437b",
"type": "Batali::Source::Git",
"subdirectory": null
}
},
{ {
"name": "firewall", "name": "firewall",
"dependencies": [ "dependencies": [
@ -905,11 +885,11 @@
">= 0.0.0" ">= 0.0.0"
] ]
], ],
"version": "2.6.1", "version": "2.6.2",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/firewall/versions/2.6.1/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/firewall/versions/2.6.2/download",
"version": "2.6.1" "version": "2.6.2"
} }
}, },
{ {
@ -920,11 +900,11 @@
">= 12.16.3" ">= 12.16.3"
] ]
], ],
"version": "1.0.2", "version": "1.1.1",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/chef_client_updater/versions/1.0.2/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/chef_client_updater/versions/1.1.1/download",
"version": "1.0.2" "version": "1.1.1"
} }
}, },
{ {
@ -970,6 +950,18 @@
"version": "3.0.0" "version": "3.0.0"
} }
}, },
{
"name": "homebrew",
"dependencies": [
],
"version": "3.0.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/homebrew/versions/3.0.0/download",
"version": "3.0.0"
}
},
{ {
"name": "ark", "name": "ark",
"dependencies": [ "dependencies": [
@ -986,38 +978,35 @@
">= 0.0.0" ">= 0.0.0"
] ]
], ],
"version": "3.0.0", "version": "3.1.0",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/ark/versions/3.0.0/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/ark/versions/3.1.0/download",
"version": "3.0.0" "version": "3.1.0"
}
},
{
"name": "homebrew",
"dependencies": [
],
"version": "3.0.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/homebrew/versions/3.0.0/download",
"version": "3.0.0"
} }
}, },
{ {
"name": "logrotate", "name": "logrotate",
"dependencies": [ "dependencies": [
[
"compat_resource",
">= 0.0.0"
]
], ],
"version": "2.1.0", "version": "2.2.0",
"source": { "source": {
"type": "Batali::Source::Site", "type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/logrotate/versions/2.1.0/download", "url": "https://supermarket.chef.io:443/api/v1/cookbooks/logrotate/versions/2.2.0/download",
"version": "2.1.0" "version": "2.2.0"
}
},
{
"name": "openssl",
"dependencies": [
],
"version": "7.1.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/openssl/versions/7.1.0/download",
"version": "7.1.0"
} }
}, },
{ {

View File

@ -2,7 +2,13 @@
This file is used to list changes made in each version of the ark cookbook. This file is used to list changes made in each version of the ark cookbook.
## 3.1.0 (2017-05-06)
- Ensure the dependencies get installed on Chef 13 Amazon Linux systems
- Require Chef 12.7+ and remove action_class.class_eval usage
## 3.0.0 (2017-04-05) ## 3.0.0 (2017-04-05)
- Rewrite of resource to custom resources. - Rewrite of resource to custom resources.
- Remove EOL platforms from testing. - Remove EOL platforms from testing.
- Update zlib URL - Update zlib URL

View File

@ -44,7 +44,7 @@ Should work on common Unix/Linux systems with typical userland utilities like ta
### Chef ### Chef
- Chef 12.5+ - Chef 12.7+
### Cookbooks ### Cookbooks

View File

@ -30,10 +30,10 @@ default['ark']['sevenzip_binary'] = nil
pkgs = %w(libtool autoconf) unless platform_family?('mac_os_x') pkgs = %w(libtool autoconf) unless platform_family?('mac_os_x')
pkgs += %w(make) unless platform_family?('mac_os_x', 'freebsd') pkgs += %w(make) unless platform_family?('mac_os_x', 'freebsd')
pkgs += %w(unzip rsync gcc) unless platform_family?('mac_os_x') pkgs += %w(unzip rsync gcc) unless platform_family?('mac_os_x')
pkgs += %w(autogen) unless platform_family?('rhel', 'fedora', 'mac_os_x', 'suse') pkgs += %w(autogen) unless platform_family?('rhel', 'fedora', 'mac_os_x', 'suse', 'amazon')
pkgs += %w(gtar) if platform?('freebsd') || platform?('smartos') pkgs += %w(gtar) if platform?('freebsd') || platform?('smartos')
pkgs += %w(gmake) if platform?('freebsd') pkgs += %w(gmake) if platform?('freebsd')
if platform_family?('rhel', 'suse') if platform_family?('rhel', 'suse', 'amazon')
if node['platform_version'].to_i >= 7 if node['platform_version'].to_i >= 7
pkgs += %w(xz bzip2 tar) pkgs += %w(xz bzip2 tar)
elsif node['platform_version'].to_i < 7 elsif node['platform_version'].to_i < 7

File diff suppressed because one or more lines are too long

View File

@ -523,6 +523,6 @@ action :configure do
end end
end end
action_class.class_eval do action_class do
include ::Ark::ProviderHelpers include ::Ark::ProviderHelpers
end end

View File

@ -2,6 +2,15 @@
This file is used to list changes made in each version of the build-essential cookbook. This file is used to list changes made in each version of the build-essential cookbook.
## 8.0.3 (2017-05-30)
- Fix solaris metadata in metadata.rb
- Remove mac_os_x_server from metata as it's not a platform
## 8.0.2 (2017-05-06)
- Remove buggy action_class.class_eval usage
## 8.0.1 (2017-04-14) ## 8.0.1 (2017-04-14)
- Test with local delivery and not Rake - Test with local delivery and not Rake

File diff suppressed because one or more lines are too long

View File

@ -44,7 +44,7 @@ action :install do
end end
end end
action_class.class_eval do action_class do
# #
# Determine if the XCode Command Line Tools are installed # Determine if the XCode Command Line Tools are installed
# #

View File

@ -1 +0,0 @@
~FC016

View File

@ -2,6 +2,23 @@
This file is used to list changes made in each version of the chef_client_updater cookbook. This file is used to list changes made in each version of the chef_client_updater cookbook.
## 1.1.1 (2017-05-11)
- Fix the initial load of mixlib-install failing
## 1.1.0 (2017-05-10)
- Add support for download URL overrides via new properties on the resource and attributes for the default recipe. This requires mixlib-install 3.2.1, which we now ensure we install in the updater resource.
- Update the default post_install action in the recipe to match the resource (exec).
- Remove usage of class_eval in the resource since we use compat_resource and class_eval causes issues with some later Chef 12 releases.
- Fix the solaris platform name in the metadata.rb.
- Remove disabling FC016 and FC023 Foodcritic rules as these no longer alert.
- Avoid infinite loops if trying to install the latest chef-client version from any channel.
- Add a true test recipe and remove unused inspec tests
- Add debug logging of the current vs. desired versions to help troubleshooting
- Added a blurb in the readme outlining init system issues surrounding kill and the chef-client starting back up
## 1.0.2 (2017-04-07) ## 1.0.2 (2017-04-07)
- Fix Chef 13 compatibility by using Kernel.exec not exec - Fix Chef 13 compatibility by using Kernel.exec not exec

View File

@ -18,10 +18,16 @@ This cookbook updates the chef-client
- compat_resource - compat_resource
### Usage ## Usage
This cookbook provides both a custom resource and a default recipe. The default recipe simply uses the custom resource with a set of attributes. You can add chef_client_updater::default to your run list or use the custom resource in a wrapper cookbook. This cookbook provides both a custom resource and a default recipe. The default recipe simply uses the custom resource with a set of attributes. You can add chef_client_updater::default to your run list or use the custom resource in a wrapper cookbook.
### Init System Caveats
When Chef runs as a service under a system init daemon such as Sys-V or systemd each chef run forks off from the main chef-client process being managed by the init system. For a chef-client upgrade to occur the running chef-client as well as the parent process must be killed, and a new chef-client must start using the updated binaries. This cookbook handles killing the chef-client, but your init system must properly handle starting the service back up. For systemd and upstart this can be handled via configuration, and chef-client cookbook 8.1.1 or later handles this by default. This functionality is not available in sys-v (RHEL 6, Debian 7, and others), so you will need to employ a secondary process such as a monitoring system to start the chef-client service.
## Resources
### chef_client_updater ### chef_client_updater
Installs the mixlib-install/mixlib-install gems and upgrades the chef-client. Installs the mixlib-install/mixlib-install gems and upgrades the chef-client.
@ -34,6 +40,8 @@ Installs the mixlib-install/mixlib-install gems and upgrades the chef-client.
- `post_install_action` - After installing the chef-client what should we do. `exec` to exec the new client or `kill` to kill the client and rely on the init system to start up the new version. Default: `exec` - `post_install_action` - After installing the chef-client what should we do. `exec` to exec the new client or `kill` to kill the client and rely on the init system to start up the new version. Default: `exec`
- `exec_command` - The chef-client command. default: $PROGRAM_NAME.split(' ').first - `exec_command` - The chef-client command. default: $PROGRAM_NAME.split(' ').first
- `exec_args` - An array of arguments to exec the chef-client with. default: ARGV - `exec_args` - An array of arguments to exec the chef-client with. default: ARGV
- `download_url_override` - The direct URL for the chef-client package.
- `checksum` - The SHA-256 checksum of the chef-client package from the direct URL.
#### examples #### examples

View File

@ -26,4 +26,10 @@ default['chef_client_updater']['prevent_downgrade'] = true
default['chef_client_updater']['version'] = 'latest' default['chef_client_updater']['version'] = 'latest'
# kill the client post install or exec the client post install for non-service based installs # kill the client post install or exec the client post install for non-service based installs
default['chef_client_updater']['post_install_action'] = 'kill' default['chef_client_updater']['post_install_action'] = 'exec'
# the download URL (for use in an air-gapped environment)
default['chef_client_updater']['download_url_override'] = nil
# the checksum of the package from "download_url_override"
default['chef_client_updater']['checksum'] = nil

View File

@ -1 +1 @@
{"name":"chef_client_updater","version":"1.0.2","description":"Upgrades chef-client to specified releases","long_description":"Upgrades chef-client to specified releases","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache-2.0","platforms":{"amazon":">= 0.0.0","centos":">= 0.0.0","debian":">= 0.0.0","mac_os_x":">= 0.0.0","opensuse":">= 0.0.0","opensuseleap":">= 0.0.0","oracle":">= 0.0.0","redhat":">= 0.0.0","scientific":">= 0.0.0","solaris":">= 0.0.0","suse":">= 0.0.0","ubuntu":">= 0.0.0","windows":">= 0.0.0","aix":">= 0.0.0"},"dependencies":{"compat_resource":">= 12.16.3"},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chef-cookbooks/chef_client_updater","issues_url":"https://github.com/chef-cookbooks/chef_client_updater/issues","chef_version":[[">= 12.1"]],"ohai_version":[]} {"name":"chef_client_updater","version":"1.1.1","description":"Upgrades chef-client to specified releases","long_description":"Upgrades chef-client to specified releases","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache-2.0","platforms":{"amazon":">= 0.0.0","centos":">= 0.0.0","debian":">= 0.0.0","mac_os_x":">= 0.0.0","opensuse":">= 0.0.0","opensuseleap":">= 0.0.0","oracle":">= 0.0.0","redhat":">= 0.0.0","scientific":">= 0.0.0","solaris2":">= 0.0.0","suse":">= 0.0.0","ubuntu":">= 0.0.0","windows":">= 0.0.0","aix":">= 0.0.0"},"dependencies":{"compat_resource":">= 12.16.3"},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chef-cookbooks/chef_client_updater","issues_url":"https://github.com/chef-cookbooks/chef_client_updater/issues","chef_version":[[">= 12.1"]],"ohai_version":[]}

View File

@ -22,4 +22,6 @@ chef_client_updater 'update chef-client' do
version node['chef_client_updater']['version'] version node['chef_client_updater']['version']
prevent_downgrade node['chef_client_updater']['prevent_downgrade'] prevent_downgrade node['chef_client_updater']['prevent_downgrade']
post_install_action node['chef_client_updater']['post_install_action'] post_install_action node['chef_client_updater']['post_install_action']
download_url_override node['chef_client_updater']['download_url_override'] if node['chef_client_updater']['download_url_override']
checksum node['chef_client_updater']['checksum'] if node['chef_client_updater']['checksum']
end end

View File

@ -26,9 +26,11 @@ property :version, [String, Symbol], default: :latest
property :post_install_action, String, default: 'exec' property :post_install_action, String, default: 'exec'
property :exec_command, String, default: $PROGRAM_NAME.split(' ').first property :exec_command, String, default: $PROGRAM_NAME.split(' ').first
property :exec_args, Array, default: ARGV property :exec_args, Array, default: ARGV
property :download_url_override, String
property :checksum, String
action :update do action :update do
if update_necessary? # ~FC023 if update_necessary?
converge_by "Upgraded chef-client #{current_version} to #{desired_version}" do converge_by "Upgraded chef-client #{current_version} to #{desired_version}" do
upgrade_command = Mixlib::ShellOut.new(mixlib_install.install_command) upgrade_command = Mixlib::ShellOut.new(mixlib_install.install_command)
upgrade_command.run_command upgrade_command.run_command
@ -37,12 +39,14 @@ action :update do
end end
end end
action_class.class_eval do action_class do
def load_mixlib_install def load_mixlib_install
gem 'mixlib-install', '~> 3.2', '>= 3.2.1'
require 'mixlib/install' require 'mixlib/install'
rescue LoadError rescue LoadError
Chef::Log.info('mixlib-install gem not found. Installing now') Chef::Log.info('mixlib-install gem not found. Installing now')
chef_gem 'mixlib-install' do chef_gem 'mixlib-install' do
version '>= 3.2.1'
compile_time true if respond_to?(:compile_time) compile_time true if respond_to?(:compile_time)
end end
@ -69,6 +73,9 @@ action_class.class_eval do
product_version: new_resource.version == 'latest' ? :latest : new_resource.version, product_version: new_resource.version == 'latest' ? :latest : new_resource.version,
} }
if new_resource.download_url_override && new_resource.checksum
options[:install_command_options] = { download_url_override: new_resource.download_url_override, checksum: new_resource.checksum }
end
Mixlib::Install.new(options) Mixlib::Install.new(options)
end end
@ -80,7 +87,7 @@ action_class.class_eval do
end end
def desired_version def desired_version
new_resource.version == 'latest' ? mixlib_install.available_versions.last : new_resource.version new_resource.version.to_sym == :latest ? mixlib_install.available_versions.last : new_resource.version
end end
# why wouldn't we use the built in update_available? method in mixlib-install? # why wouldn't we use the built in update_available? method in mixlib-install?
@ -90,6 +97,7 @@ action_class.class_eval do
load_mixlib_versioning load_mixlib_versioning
cur_version = Mixlib::Versioning.parse(current_version) cur_version = Mixlib::Versioning.parse(current_version)
des_version = Mixlib::Versioning.parse(desired_version) des_version = Mixlib::Versioning.parse(desired_version)
Chef::Log.debug("The current chef-client version is #{cur_version} and the desired version is #{desired_version}")
new_resource.prevent_downgrade ? (des_version > cur_version) : (des_version != cur_version) new_resource.prevent_downgrade ? (des_version > cur_version) : (des_version != cur_version)
end end

View File

@ -2,6 +2,21 @@
This file is used to list changes made in each version of the nginx cookbook. This file is used to list changes made in each version of the nginx cookbook.
## 6.1.1 (2017-06-08)
- Use multipackage installs in the pagespeed recipe to speed things up
- Several fixes for Amazon Linux on Chef 13+
## 6.1.0 (2017-06-07)
- Add attributes for setting the repository URLs
- Fix support for Amazon Linux repos on Chef 13+
## 6.0.3 (2017-06-05)
- Correctly compare nginx versions with multiple digits so 1.10 is properly recognized as coming after 1.2.
## 6.0.2 (2017-04-27) ## 6.0.2 (2017-04-27)
- Resolve name conflicts in the resource - Resolve name conflicts in the resource

View File

@ -26,11 +26,11 @@ The following cookbooks are direct dependencies because they're used for common
The following platforms are supported and tested with Test Kitchen: The following platforms are supported and tested with Test Kitchen:
- Ubuntu 12.04+ - Ubuntu 14.04+
- CentOS 5+ - CentOS 6+
- Debian 7+ - Debian 7+
- openSUSE 13.2+ - openSUSE
- FreeBSD 9+ - FreeBSD
Other Debian and RHEL family distributions are assumed to work. Other Debian and RHEL family distributions are assumed to work.
@ -119,14 +119,6 @@ Generally used attributes. Some have platform specific values. See `attributes/d
- `node['nginx']['extra_configs']` - a Hash of key/values to nginx configuration. - `node['nginx']['extra_configs']` - a Hash of key/values to nginx configuration.
### chef_nginx::echo
These attributes are used in the `chef_nginx::http_echo_module` recipe.
- `node['nginx']['echo']['version']` - The version of `http_echo` you want (default: 0.59)
- `node['nginx']['echo']['url']` - URL for the tarball.
- `node['nginx']['echo']['checksum']` - Checksum of the tarball.
### chef_nginx::devel ### chef_nginx::devel
These attributes are used in the `chef_nginx::ngx_devel_module` recipe. These attributes are used in the `chef_nginx::ngx_devel_module` recipe.
@ -135,6 +127,14 @@ These attributes are used in the `chef_nginx::ngx_devel_module` recipe.
- `node['nginx']['devel']['url']` - The URL of the nginx devel module tar.gz file - `node['nginx']['devel']['url']` - The URL of the nginx devel module tar.gz file
- `node['nginx']['devel']['checksum']` - The checksum of the nginx devel module tar.gz file - `node['nginx']['devel']['checksum']` - The checksum of the nginx devel module tar.gz file
### chef_nginx::echo
These attributes are used in the `chef_nginx::http_echo_module` recipe.
- `node['nginx']['echo']['version']` - The version of `http_echo` you want (default: 0.59)
- `node['nginx']['echo']['url']` - URL for the tarball.
- `node['nginx']['echo']['checksum']` - Checksum of the tarball.
### chef_nginx::geoip ### chef_nginx::geoip
These attributes are used in the `chef_nginx::http_geoip_module` recipe. Please note that the `country_dat_checksum` and `city_dat_checksum` are based on downloads from a datacenter in Fremont, CA, USA. You really should override these with checksums for the geo tarballs from your node location. These attributes are used in the `chef_nginx::http_geoip_module` recipe. Please note that the `country_dat_checksum` and `city_dat_checksum` are based on downloads from a datacenter in Fremont, CA, USA. You really should override these with checksums for the geo tarballs from your node location.
@ -159,6 +159,13 @@ From: <http://nginx.org/en/docs/http/ngx_http_realip_module.html>
- `node['nginx']['realip']['addresses']` - Addresses to use for the `http_realip` configuration. - `node['nginx']['realip']['addresses']` - Addresses to use for the `http_realip` configuration.
- `node['nginx']['realip']['real_ip_recursive']` - If recursive search is enabled, the original client address that matches one of the trusted addresses is replaced by the last non-trusted address sent in the request header field. Can be on "on" or "off" (default). - `node['nginx']['realip']['real_ip_recursive']` - If recursive search is enabled, the original client address that matches one of the trusted addresses is replaced by the last non-trusted address sent in the request header field. Can be on "on" or "off" (default).
### chef_nginx::openssl_source
These attributes are used in the `chef_nginx::openssl_source` recipe.
- `node['nginx']['openssl_source']['version']` - The version of OpenSSL you want to download and use (default: 1.0.1t)
- `node['nginx']['openssl_source']['url']` - The url for the OpenSSL source
### chef_nginx::passenger ### chef_nginx::passenger
These attributes are used in the `chef_nginx::passenger` recipe. These attributes are used in the `chef_nginx::passenger` recipe.
@ -184,13 +191,6 @@ Basic configuration to use the official Phusion Passenger repositories:
- `node['nginx']['package_name']` - 'nginx-extras' - `node['nginx']['package_name']` - 'nginx-extras'
- `node['nginx']['passenger']['install_method']` - 'package' - `node['nginx']['passenger']['install_method']` - 'package'
### chef_nginx::openssl_source
These attributes are used in the `chef_nginx::openssl_source` recipe.
- `node['nginx']['openssl_source']['version']` - The version of OpenSSL you want to download and use (default: 1.0.1t)
- `node['nginx']['openssl_source']['url']` - The url for the OpenSSL source
### chef_nginx::rate_limiting ### chef_nginx::rate_limiting
- `node['nginx']['enable_rate_limiting']` - set to true to enable rate limiting (`limit_req_zone` in nginx.conf) - `node['nginx']['enable_rate_limiting']` - set to true to enable rate limiting (`limit_req_zone` in nginx.conf)
@ -198,6 +198,11 @@ These attributes are used in the `chef_nginx::openssl_source` recipe.
- `node['nginx']['rate_limiting_backoff']` - sets the backoff time for `limit_req_zone`. - `node['nginx']['rate_limiting_backoff']` - sets the backoff time for `limit_req_zone`.
- `node['nginx']['rate_limit']` - set the rate limit amount for `limit_req_zone`. - `node['nginx']['rate_limit']` - set the rate limit amount for `limit_req_zone`.
### chef_nginx::repo
- `node['nginx']['upstream_repository']` - the URL to use for the package repository resource; default is set based on platform type
- `node['nginx']['repo_signing_key']` - The URL from which package signing/gpg key is retrieved
### chef_nginx::socketproxy ### chef_nginx::socketproxy
These attributes are used in the `chef_nginx::socketproxy` recipe. These attributes are used in the `chef_nginx::socketproxy` recipe.

View File

@ -41,11 +41,7 @@ default['nginx']['repo_source'] = 'nginx'
default['nginx']['install_method'] = 'package' default['nginx']['install_method'] = 'package'
case node['platform_family'] case node['platform_family']
when 'debian' when 'rhel', 'fedora', 'amazon'
default['nginx']['user'] = 'www-data'
when 'rhel'
default['nginx']['user'] = 'nginx'
when 'fedora'
default['nginx']['user'] = 'nginx' default['nginx']['user'] = 'nginx'
when 'freebsd' when 'freebsd'
default['nginx']['package_name'] = 'www/nginx' default['nginx']['package_name'] = 'www/nginx'
@ -57,7 +53,7 @@ when 'freebsd'
when 'suse' when 'suse'
default['nginx']['user'] = 'wwwrun' default['nginx']['user'] = 'wwwrun'
default['nginx']['group'] = 'www' default['nginx']['group'] = 'www'
else else # debian probably
default['nginx']['user'] = 'www-data' default['nginx']['user'] = 'www-data'
end end

View File

@ -19,17 +19,24 @@
# limitations under the License. # limitations under the License.
# #
case node['platform_family'] default['nginx']['upstream_repository'] =
when 'rhel', 'fedora' case node['platform_family']
default['nginx']['upstream_repository'] = case node['platform'] when 'amazon' # Chef 13+ on amazon linux
when 'centos' 'http://nginx.org/packages/rhel/6/$basearch/'
# See http://wiki.nginx.org/Install when 'rhel', 'fedora'
"http://nginx.org/packages/centos/#{node['platform_version'].to_i}/$basearch/" case node['platform']
when 'amazon' when 'centos'
'http://nginx.org/packages/rhel/6/$basearch/' # See http://wiki.nginx.org/Install
else "http://nginx.org/packages/centos/#{node['platform_version'].to_i}/$basearch/"
"http://nginx.org/packages/rhel/#{node['platform_version'].to_i}/$basearch/" when 'amazon' # Chef < 13 on Amazon
end 'http://nginx.org/packages/rhel/6/$basearch/'
when 'debian' else
default['nginx']['upstream_repository'] = "http://nginx.org/packages/#{node['platform']}" "http://nginx.org/packages/rhel/#{node['platform_version'].to_i}/$basearch/"
end end
when 'debian'
"http://nginx.org/packages/#{node['platform']}"
when 'suse'
'http://nginx.org/packages/sles/12'
end
default['nginx']['repo_signing_key'] = 'http://nginx.org/keys/nginx_signing.key'

View File

@ -0,0 +1,37 @@
class NginxVersion
include Comparable
attr_reader :version
def initialize(version)
@version = version
end
def <=>(other)
lhsegments = segments
rhsegments = other.segments
parts = [lhsegments.size, rhsegments.size].max
(0..(parts - 1)).each do |index|
lhs = lhsegments[index] || 0
rhs = rhsegments[index] || 0
next if lhs == rhs
return lhs <=> rhs
end
0
end
def to_s
version
end
protected
def segments
version.split('.').map { |part| Integer(part) }
end
end

File diff suppressed because one or more lines are too long

View File

@ -43,7 +43,7 @@ end
end end
end end
if !node['nginx']['default_site_enabled'] && platform_family?('rhel', 'fedora') if !node['nginx']['default_site_enabled'] && platform_family?('rhel', 'fedora', 'amazon')
%w(default.conf example_ssl.conf).each do |config| %w(default.conf example_ssl.conf).each do |config|
file "/etc/nginx/conf.d/#{config}" do file "/etc/nginx/conf.d/#{config}" do
action :delete action :delete

View File

@ -22,7 +22,7 @@ remote_file psol_src_filepath do
end end
package_array = value_for_platform_family( package_array = value_for_platform_family(
%w(rhel) => node['nginx']['pagespeed']['packages']['rhel'], %w(rhel amazon) => node['nginx']['pagespeed']['packages']['rhel'],
%w(debian) => node['nginx']['pagespeed']['packages']['debian'] %w(debian) => node['nginx']['pagespeed']['packages']['debian']
) )

View File

@ -18,16 +18,12 @@
# #
packages = value_for_platform_family( packages = value_for_platform_family(
%w(rhel) => node['nginx']['passenger']['packages']['rhel'], %w(rhel amazon) => node['nginx']['passenger']['packages']['rhel'],
%w(fedora) => node['nginx']['passenger']['packages']['fedora'], %w(fedora) => node['nginx']['passenger']['packages']['fedora'],
%w(debian) => node['nginx']['passenger']['packages']['debian'] %w(debian) => node['nginx']['passenger']['packages']['debian']
) )
unless packages.empty? package packages unless packages.empty?
packages.each do |name|
package name
end
end
gem_package 'rake' if node['nginx']['passenger']['install_rake'] gem_package 'rake' if node['nginx']['passenger']['install_rake']

View File

@ -19,12 +19,12 @@
# #
case node['platform_family'] case node['platform_family']
when 'rhel' when 'rhel', 'amazon'
yum_repository 'nginx' do yum_repository 'nginx' do
description 'Nginx.org Repository' description 'Nginx.org Repository'
baseurl node['nginx']['upstream_repository'] baseurl node['nginx']['upstream_repository']
gpgkey 'http://nginx.org/keys/nginx_signing.key' gpgkey node['nginx']['repo_signing_key']
action :create action :create
end end
@ -32,8 +32,8 @@ when 'suse'
zypper_repo 'nginx' do zypper_repo 'nginx' do
repo_name 'Nginx.org Repository' repo_name 'Nginx.org Repository'
uri 'http://nginx.org/packages/sles/12' uri node['nginx']['upstream_repository']
key 'http://nginx.org/keys/nginx_signing.key' key node['nginx']['repo_signing_key']
end end
when 'debian' when 'debian'
@ -43,7 +43,7 @@ when 'debian'
distribution node['lsb']['codename'] distribution node['lsb']['codename']
components %w(nginx) components %w(nginx)
deb_src true deb_src true
key 'http://nginx.org/keys/nginx_signing.key' key node['nginx']['repo_signing_key']
end end
else else

View File

@ -21,7 +21,7 @@
# limitations under the License. # limitations under the License.
# #
raise "#{node['platform']} is not a supported platform in the nginx::source recipe" unless platform_family?('rhel', 'fedora', 'debian', 'suse') raise "#{node['platform']} is not a supported platform in the nginx::source recipe" unless platform_family?('rhel', 'amazon', 'fedora', 'debian', 'suse')
node.normal['nginx']['binary'] = node['nginx']['source']['sbin_path'] node.normal['nginx']['binary'] = node['nginx']['source']['sbin_path']
node.normal['nginx']['daemon_disable'] = true node.normal['nginx']['daemon_disable'] = true
@ -42,7 +42,7 @@ src_filepath = "#{Chef::Config['file_cache_path']}/nginx-#{node['nginx']['source
# install prereqs # install prereqs
package value_for_platform_family( package value_for_platform_family(
%w(rhel fedora) => %w(pcre-devel openssl-devel tar), %w(rhel fedora amazon) => %w(pcre-devel openssl-devel tar),
%w(suse) => %w(pcre-devel libopenssl-devel tar), %w(suse) => %w(pcre-devel libopenssl-devel tar),
%w(debian) => %w(libpcre3 libpcre3-dev libssl-dev tar) %w(debian) => %w(libpcre3 libpcre3-dev libssl-dev tar)
) )

View File

@ -2,6 +2,6 @@
set_real_ip_from <%= address %>; set_real_ip_from <%= address %>;
<% end -%> <% end -%>
real_ip_header <%= node['nginx']['realip']['header'] %>; real_ip_header <%= node['nginx']['realip']['header'] %>;
<% if node['nginx']['version'].to_f >= 1.2 -%> <% if NginxVersion.new(node['nginx']['version']) >= NginxVersion.new('1.2') -%>
real_ip_recursive <%= node['nginx']['realip']['real_ip_recursive'] %>; real_ip_recursive <%= node['nginx']['realip']['real_ip_recursive'] %>;
<% end -%> <% end -%>

View File

@ -2,6 +2,12 @@ firewall Cookbook CHANGELOG
======================= =======================
This file is used to list changes made in each version of the firewall cookbook. This file is used to list changes made in each version of the firewall cookbook.
v2.6.2 (2017-06-01)
-------------------
* Incorrect file checking on Ubuntu, double file write (#173)
* Added testing on CentOS 6.9
* Clarify metadata that we're not working on Amazon Linux (#172)
v2.6.1 (2017-04-21) v2.6.1 (2017-04-21)
------------------- -------------------
* Add recipe to disable firewall (#164) * Add recipe to disable firewall (#164)

View File

@ -43,7 +43,7 @@ class Chef
rule_files = %w(rules.v4) rule_files = %w(rules.v4)
rule_files << 'rules.v6' if ipv6_enabled?(new_resource) rule_files << 'rules.v6' if ipv6_enabled?(new_resource)
rule_files.each do |svc| rule_files.each do |svc|
next unless ::File.exist?("/etc/iptables/#{svc}") next if ::File.exist?("/etc/iptables/#{svc}")
# must create empty file for service to start # must create empty file for service to start
f = lookup_or_create_rulesfile(svc) f = lookup_or_create_rulesfile(svc)

View File

@ -43,7 +43,7 @@ class Chef
rule_files = %w(rules.v4) rule_files = %w(rules.v4)
rule_files << 'rules.v6' if ipv6_enabled?(new_resource) rule_files << 'rules.v6' if ipv6_enabled?(new_resource)
rule_files.each do |svc| rule_files.each do |svc|
next unless ::File.exist?("/etc/iptables/#{svc}") next if ::File.exist?("/etc/iptables/#{svc}")
# must create empty file for service to start # must create empty file for service to start
f = lookup_or_create_rulesfile(svc) f = lookup_or_create_rulesfile(svc)

File diff suppressed because one or more lines are too long

View File

@ -13,3 +13,4 @@ Gemfile.lock
\#*# \#*#
bin/* bin/*
metadata.json metadata.json
Gemfile.lock

View File

@ -4,58 +4,31 @@ driver_config:
require_chef_omnibus: true require_chef_omnibus: true
platforms: platforms:
- name: ubuntu-14.04 - name: ubuntu-12.04
driver_config: - name: ubuntu-14.04
box: opscode_ubuntu-14.04_provisionerless - name: ubuntu-16.04
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box - name: debian-7.11
- name: ubuntu-12.04 - name: debian-8.5
driver_config: - name: centos-6.8
box: opscode_ubuntu-12.04_provisionerless - name: centos-7.2
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box - name: freebsd-9.3
- name: ubuntu-10.04 - name: freebsd-10.3
driver_config: - name: fedora-21
box: opscode_ubuntu-10.04_provisionerless - name: fedora-22
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-10.04_chef-provisionerless.box - name: fedora-23
- name: debian-6 - name: fedora-24
driver_config:
box: opscode_debian-6.0.8_provisionerless
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-6.0.8_chef-provisionerless.box
- name: debian-7
driver_config:
box: opscode_debian-7.2.0_provisionerless
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-7.2.0_chef-provisionerless.box
- name: centos-6.4
driver_config:
box: opscode_centos-6.4_provisionerless
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.4_chef-provisionerless.box
#- name: freebsd-9.2
# driver_config:
# box: opscode_freebsd-9.2_provisionerless
# box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_freebsd-9.2_chef-provisionerless.box
- name: freebsd-10
driver_config:
box: opscode_freebsd-10.0_provisionerless
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_freebsd-10.0_chef-provisionerless.box
- name: fedora-19
driver_config:
box: opscode_fedora-19_chef-provisionerless
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-19_chef-provisionerless.box
- name: fedora-20
driver_config:
box: opscode_fedora-20_chef-provisionerless
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_fedora-20_chef-provisionerless.box
suites: suites:
- name: default - name: default
run_list: run_list:
- recipe[hostname::default] - recipe[hostname::default]
attributes: attributes:
set_fqdn: test.example.com set_fqdn: test.example.com
- name: wildcard - name: wildcard
run_list: run_list:
- recipe[hostname::default] - recipe[hostname::default]
provisioner: provisioner:
solo_rb: solo_rb:
node_name: test node_name: test
attributes: attributes:
set_fqdn: '*.example.com' set_fqdn: '*.example.com'

View File

@ -0,0 +1 @@
--color

View File

@ -1,12 +1,23 @@
AllCops: AllCops:
DisplayCopNames: true
Exclude: Exclude:
- tmp/** - tmp/**
Documentation: Lint/AmbiguousBlockAssociation:
Enabled: false Enabled: false
LineLength: Metrics/BlockLength:
Enabled: false Enabled: false
SingleSpaceBeforeFirstArg: Metrics/LineLength:
Enabled: false
Style/Documentation:
Exclude:
- Thorfile
Style/PercentLiteralDelimiters:
Enabled: false
Style/SingleSpaceBeforeFirstArg:
Enabled: false Enabled: false

View File

@ -1,9 +1,10 @@
bundler_args: --without integration bundler_args: --without integration
before_script: bundle exec berks install before_script: bundle exec berks install
script: bundle exec strainer test script: bundle exec rake
language: ruby language: ruby
rvm: rvm:
- 1.9.3 - 2.3.1
sudo: false
notifications: notifications:
hipchat: hipchat:
secure: ! 'mTePogP3SZVXbZ8l3o1yN+uszEEwQY3WgBXXXQc4hV1nLGhAXgjgj5ueCKAE secure: ! 'mTePogP3SZVXbZ8l3o1yN+uszEEwQY3WgBXXXQc4hV1nLGhAXgjgj5ueCKAE

View File

@ -1,8 +1,8 @@
# -*- ruby -*- # -*- ruby -*-
source "https://supermarket.getchef.com" source 'https://supermarket.getchef.com'
metadata metadata
group :integration do group :integration do
cookbook "minitest-handler" cookbook 'minitest-handler'
end end

View File

@ -1,5 +1,18 @@
# Change History # Change History
0.4.2 (2017-05-04)
==================
- #51: Make host file idempotent on RHEL
- #52: Add `append_hostsfile_ip` logic for improved idempotence
- #55: Ensure sysctl `kernel.hostname` set correctly on RHEL
0.4.1 (2017-04-24)
==================
- #43: Set unique hosts file entry for hostname
- #44: Make hostname mapping to `127.0.0.1` optional
- #59: Updates to resolve deprecations warnings
- #60, #61: various test fixes
0.4.0 (2015-03-16) 0.4.0 (2015-03-16)
================== ==================
- #40: Use file resources with lazy eval and notifies to prevent network restarts from occurring on every chef run (Matt Kasa) - #40: Use file resources with lazy eval and notifies to prevent network restarts from occurring on every chef run (Matt Kasa)

View File

@ -1,14 +1,13 @@
source 'https://rubygems.org' source 'https://rubygems.org'
gem 'berkshelf' gem 'berkshelf'
gem 'chef', '~> 11.10' gem 'chef', '~> 12.13'
gem 'chefspec' gem 'chefspec'
gem 'foodcritic', '~> 3.0' gem 'foodcritic'
gem 'rake' gem 'rake'
gem 'strainer'
gem 'rubocop' gem 'rubocop'
group :integration do group :integration do
gem 'test-kitchen', '~> 1.0'
gem 'kitchen-vagrant' gem 'kitchen-vagrant'
gem 'test-kitchen'
end end

View File

@ -0,0 +1,20 @@
Copyright (c) 2011-2017 Maciej Pasternacki
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,5 +1,7 @@
# hostname cookbook # hostname cookbook
[![Build Status](https://travis-ci.org/3ofcoins/chef-cookbook-hostname.svg?branch=master)](https://travis-ci.org/3ofcoins/chef-cookbook-hostname)
[![Chef cookbook](https://img.shields.io/cookbook/v/hostname.svg)](https://supermarket.chef.io/cookbooks/hostname)
## Description ## Description
Sets hostname and FQDN of the node. The latest code is hosted at Sets hostname and FQDN of the node. The latest code is hosted at
@ -30,7 +32,13 @@ and have node set its FQDN and hostname based on its chef node name
- `node['hostname_cookbook']['hostsfile_ip']` -- IP used in - `node['hostname_cookbook']['hostsfile_ip']` -- IP used in
`/etc/hosts` to correctly set FQDN (default: `127.0.1.1`) `/etc/hosts` to correctly set FQDN (default: `127.0.1.1`)
- `node['hostname_cookbook']['hostsfile_aliases']` -- list of aliases used in
`/etc/hosts` for the ip set above (default: [`hostname`])
- `node['hostname_cookbook']['hostsfile_include_hostname_in_aliases']` -- whether to include the hostname
at the end of the aliases list above (default: true)
- `node['hostname_cookbook']['append_hostsfile_ip']` -- Set to `false` to
prevent an entry for the node's hostname from being appended in `/etc/hosts` (default: `true`)
## Recipes ## Recipes

View File

@ -0,0 +1,15 @@
require 'foodcritic'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
RuboCop::RakeTask.new(:rubocop)
FoodCritic::Rake::LintTask.new do |t|
t.options = {
fail_tags: ['any']
}
end
RSpec::Core::RakeTask.new(:spec)
task default: %w[foodcritic rubocop spec]

View File

@ -1,4 +0,0 @@
rubocop: rubocop $COOKBOOK
knife test: knife cookbook test $COOKBOOK
foodcritic: foodcritic -c 11.6.0 --tags ~FC015 --epic-fail any $SANDBOX/$COOKBOOK
chefspec: rspec $SANDBOX/$COOKBOOK

View File

@ -13,13 +13,12 @@ And then, to install all cookbooks:
Local Local
----- -----
$ bundle exec strainer test $ bundle exec rake
The above runs: The above runs:
- rubocop - rubocop lint
- `knife cookbook test` tests - Foodcritic lint
- Food Critic lint
- Chefspec tests - Chefspec tests
Chefspec tests (the interesting part) are in `spec/`. Chefspec tests (the interesting part) are in `spec/`.

View File

@ -6,12 +6,12 @@ require 'bundler/setup'
require 'shellwords' require 'shellwords'
class Cookbook < Thor class Cookbook < Thor
COOKBOOK_NAME = 'hostname' COOKBOOK_NAME = 'hostname'.freeze
COOKBOOK_CATEGORY = 'utilities' COOKBOOK_CATEGORY = 'utilities'.freeze
include Thor::Actions include Thor::Actions
desc :edit, "Edit cookbook in browser" desc :edit, 'Edit cookbook in browser'
def edit def edit
open "http://community.opscode.com/cookbooks/#{COOKBOOK_NAME}/edit" open "http://community.opscode.com/cookbooks/#{COOKBOOK_NAME}/edit"
end end
@ -35,7 +35,7 @@ class Cookbook < Thor
def open_cmd def open_cmd
@open_cmd ||= %w[open xdg-open].find do |command| @open_cmd ||= %w[open xdg-open].find do |command|
system "which #{command} >/dev/null 2>&1" system "which #{command} >/dev/null 2>&1"
$?.success? $CHILD_STATUS.success?
end end
end end
end end

View File

@ -1,4 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
default['hostname_cookbook']['hostsfile_ip'] = '127.0.1.1' default['hostname_cookbook']['hostsfile_ip'] = '127.0.1.1'
default['hostname_cookbook']['hostsfile_ip_interface'] = 'lo0' if platform == 'freebsd' default['hostname_cookbook']['hostsfile_ip_interface'] = 'lo0' if node['platform'] == 'freebsd'
default['hostname_cookbook']['hostsfile_aliases'] = []
default['hostname_cookbook']['hostsfile_include_hostname_in_aliases'] = true
default['hostname_cookbook']['append_hostsfile_ip'] = true

View File

@ -6,10 +6,15 @@ maintainer_email 'maciej@3ofcoins.net'
license 'MIT' license 'MIT'
description 'Configures hostname and FQDN' description 'Configures hostname and FQDN'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.4.0' version '0.4.2'
supports 'debian' supports 'debian'
supports 'ubuntu' supports 'ubuntu'
supports 'freebsd' supports 'freebsd'
depends 'hostsfile' depends 'hostsfile'
source_url 'https://github.com/3ofcoins/chef-cookbook-hostname' if respond_to?(:source_url)
issues_url 'https://github.com/3ofcoins/chef-cookbook-hostname/issues' if respond_to?(:issues_url)
chef_version '>= 12.1' if respond_to?(:chef_version)

View File

@ -31,7 +31,10 @@ if fqdn
fqdn =~ /^([^.]+)/ fqdn =~ /^([^.]+)/
hostname = Regexp.last_match[1] hostname = Regexp.last_match[1]
case node['platform'] aliases = node['hostname_cookbook']['hostsfile_aliases']
aliases += [hostname] if node['hostname_cookbook']['hostsfile_include_hostname_in_aliases']
case node['platform_family']
when 'freebsd' when 'freebsd'
directory '/etc/rc.conf.d' do directory '/etc/rc.conf.d' do
mode '0755' mode '0755'
@ -56,7 +59,7 @@ if fqdn
notifies :reload, 'ohai[reload_hostname]', :immediately notifies :reload, 'ohai[reload_hostname]', :immediately
end end
when 'centos', 'redhat', 'amazon', 'scientific' when 'rhel'
service 'network' do service 'network' do
action :nothing action :nothing
end end
@ -66,6 +69,7 @@ if fqdn
content lazy { content lazy {
::IO.read(hostfile).gsub(/^HOSTNAME=.*$/, "HOSTNAME=#{fqdn}") ::IO.read(hostfile).gsub(/^HOSTNAME=.*$/, "HOSTNAME=#{fqdn}")
} }
not_if { ::IO.read(hostfile) =~ /^HOSTNAME=#{fqdn}$/ }
notifies :reload, 'ohai[reload_hostname]', :immediately notifies :reload, 'ohai[reload_hostname]', :immediately
notifies :restart, 'service[network]', :delayed notifies :restart, 'service[network]', :delayed
end end
@ -73,10 +77,13 @@ if fqdn
sysctl = '/etc/sysctl.conf' sysctl = '/etc/sysctl.conf'
file sysctl do file sysctl do
action :create action :create
regex = /^kernel\.hostname=.*/
newline = "kernel.hostname=#{hostname}"
content lazy { content lazy {
::IO.read(sysctl) + "kernel.hostname=#{hostname}\n" original = ::IO.read(sysctl)
original.match(regex) ? original.gsub(regex, newline) : original + newline
} }
not_if { ::IO.read(sysctl) =~ /^kernel\.hostname=#{hostname}$/ } not_if { ::IO.read(sysctl).scan(regex).last == newline }
notifies :reload, 'ohai[reload_hostname]', :immediately notifies :reload, 'ohai[reload_hostname]', :immediately
notifies :restart, 'service[network]', :delayed notifies :restart, 'service[network]', :delayed
end end
@ -84,6 +91,14 @@ if fqdn
only_if { node['hostname'] != hostname } only_if { node['hostname'] != hostname }
notifies :reload, 'ohai[reload_hostname]', :immediately notifies :reload, 'ohai[reload_hostname]', :immediately
end end
# update /etc/hostname in RHEL7+
file '/etc/hostname' do
content "#{hostname}\n"
mode '0644'
only_if { ::File.exist?('/etc/hostname') }
notifies :reload, 'ohai[reload_hostname]', :immediately
end
else else
file '/etc/hostname' do file '/etc/hostname' do
content "#{hostname}\n" content "#{hostname}\n"
@ -106,9 +121,11 @@ if fqdn
hostsfile_entry 'set hostname' do hostsfile_entry 'set hostname' do
ip_address node['hostname_cookbook']['hostsfile_ip'] ip_address node['hostname_cookbook']['hostsfile_ip']
hostname fqdn hostname fqdn
aliases [hostname] aliases aliases
unique true
action :create action :create
notifies :reload, 'ohai[reload_hostname]', :immediately notifies :reload, 'ohai[reload_hostname]', :immediately
only_if { node['hostname_cookbook']['append_hostsfile_ip'] }
end end
ohai 'reload_hostname' do ohai 'reload_hostname' do

View File

@ -1,3 +1,15 @@
*.rbc
.config
coverage
InstalledFiles
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
_Store
*~ *~
*# *#
.#* .#*
@ -7,19 +19,33 @@
*.tmp *.tmp
*.bk *.bk
*.bkup *.bkup
.kitchen.local.yml
Berksfile.lock
.bundle/ # ruby/bundler files
.cache/
.kitchen/
.vagrant/
.vagrant.d/
bin/
tmp/
vendor/
# RVM
.ruby-version .ruby-version
.ruby-gemset .ruby-gemset
.rvmrc .rvmrc
Gemfile.lock
.bundle
*.gem
# YARD artifacts
.yardoc
_yardoc
doc/
.idea
# chef stuff
Berksfile.lock
.kitchen
.kitchen.local.yml
vendor/
.coverage/
.zero-knife.rb
Policyfile.lock.json
Cheffile.lock
.librarian/
# vagrant stuff
.vagrant/
.vagrant.d/
.kitchen/

View File

@ -1,12 +1,21 @@
driver_plugin: vagrant driver:
driver_config: name: vagrant
require_chef_omnibus: true
provisioner:
name: chef_zero
# We have tests that ensure our deprecated features still
# work so we can't turn this on globally.
# deprecations_as_errors: true
platforms: platforms:
- name: ubuntu-12.04 - name: centos-6.8
run_list: - name: centos-7.3
- recipe[fake::prep] # - name: debian-7.11
- name: centos-6.7 - name: debian-8.6
- name: fedora-25
- name: opensuse-leap-42.1
- name: ubuntu-14.04
- name: ubuntu-16.04
suites: suites:
- name: default - name: default

View File

@ -1,4 +0,0 @@
AllCops:
Exclude:
- vendor/**
- .kitchen/**

View File

@ -1,10 +1,20 @@
# Use Travis's cointainer based infrastructure
sudo: false sudo: false
addons:
apt:
sources:
- chef-stable-precise
packages:
- chefdk
branches: branches:
only: only:
- master - master
language: ruby
cache: bundler # Ensure we make ChefDK's Ruby the default
rvm: install: echo "Using ChefDK for all dependencies"
- 2.2 before_script:
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
script: script:
- make travis - make travis

View File

@ -1,7 +1,7 @@
source "https://supermarket.getchef.com" source 'https://supermarket.chef.io'
metadata metadata
group :development do group :development do
cookbook "fake", path: "test/fixtures/cookbooks/fake" cookbook 'fake', path: 'test/fixtures/cookbooks/fake'
end end

View File

@ -3,6 +3,34 @@ logrotate Cookbook CHANGELOG
This file is used to list changes made in each version of the This file is used to list changes made in each version of the
logrotate cookbook. logrotate cookbook.
v2.2.0
------
# Compatibility Notes
The `compat_resource` dependency was removed. This means we now
require Chef 12.5 or higher. It also means we now better support Chef
13.
# Enhancements
- The global configuration now supports scripts.
- The package install action (upgrade by default) is now configurable
via an attribute.
- The development environment now more closely follows modern cookbook
practices.
# Bug Fixes
- ChefSpec matcher now correctly calls ChefSpec.define_matcher.
-
# Contributors
- Austin Heiman
- Baptiste Courtois
- Bogdan Katynski
- Thomas Dziedzic
- Tim Smith
v2.1.0 v2.1.0
------ ------

View File

@ -16,7 +16,7 @@
### Requirements ### Requirements
- Ruby 2.0+ - Ruby 2.0+
- Bundler (`gem install bundler`) - Latest ChefDK
- [Vagrant](https://vagrantup.com) - [Vagrant](https://vagrantup.com)
- [VirtualBox](https://virtualbox.org) - [VirtualBox](https://virtualbox.org)
@ -24,15 +24,15 @@
1. Clone the git repository from GitHub: 1. Clone the git repository from GitHub:
$ git clone git@github.com:stevendanna/logrotate.git git clone git@github.com:stevendanna/logrotate.git
2. Install the dependencies using bundler: 2. Ensure you have ChefDK installed:
$ bundle install chef --version
3. Create a branch for your changes: 3. Create a branch for your changes:
$ git checkout -b my_bug_fix git checkout -b my_bug_fix
4. Make any changes 4. Make any changes

View File

@ -1,11 +0,0 @@
source "https://rubygems.org"
gem "berkshelf", "~> 4.0"
gem "chefspec", "~> 4.0"
gem "foodcritic", "~> 6.0"
gem "chefstyle", github: "chef/chefstyle"
group :integration do
gem "test-kitchen", "~> 1.0"
gem "kitchen-vagrant", "~> 0.11"
end

View File

@ -1,275 +0,0 @@
GIT
remote: git://github.com/chef/chefstyle.git
revision: cc37808b7849fdcf49f04011626143940f83fe92
specs:
chefstyle (0.3.1)
rubocop (= 0.39.0)
GEM
remote: https://rubygems.org/
specs:
addressable (2.4.0)
artifactory (2.3.2)
ast (2.2.0)
berkshelf (4.3.2)
addressable (~> 2.3, >= 2.3.4)
berkshelf-api-client (~> 2.0, >= 2.0.2)
buff-config (~> 1.0)
buff-extensions (~> 1.0)
buff-shell_out (~> 0.1)
celluloid (= 0.16.0)
celluloid-io (~> 0.16.1)
cleanroom (~> 1.0)
faraday (~> 0.9)
httpclient (~> 2.7)
minitar (~> 0.5, >= 0.5.4)
octokit (~> 4.0)
retryable (~> 2.0)
ridley (~> 4.5)
solve (~> 2.0)
thor (~> 0.19)
berkshelf-api-client (2.0.2)
faraday (~> 0.9.1)
httpclient (~> 2.7.0)
ridley (~> 4.5)
buff-config (1.0.1)
buff-extensions (~> 1.0)
varia_model (~> 0.4)
buff-extensions (1.0.0)
buff-ignore (1.1.1)
buff-ruby_engine (0.1.0)
buff-shell_out (0.2.0)
buff-ruby_engine (~> 0.1.0)
builder (3.2.2)
celluloid (0.16.0)
timers (~> 4.0.0)
celluloid-io (0.16.2)
celluloid (>= 0.16.0)
nio4r (>= 1.1.0)
chef (12.9.38)
bundler (>= 1.10)
chef-config (= 12.9.38)
chef-zero (~> 4.5)
diff-lcs (~> 1.2, >= 1.2.4)
erubis (~> 2.7)
ffi-yajl (~> 2.2)
highline (~> 1.6, >= 1.6.9)
mixlib-authentication (~> 1.4)
mixlib-cli (~> 1.4)
mixlib-log (~> 1.3)
mixlib-shellout (~> 2.0)
net-sftp (~> 2.1, >= 2.1.2)
net-ssh (>= 2.9, < 4.0)
net-ssh-multi (~> 1.1)
ohai (>= 8.6.0.alpha.1, < 9)
plist (~> 3.2)
proxifier (~> 1.0)
rspec-core (~> 3.4)
rspec-expectations (~> 3.4)
rspec-mocks (~> 3.4)
rspec_junit_formatter (~> 0.2.0)
serverspec (~> 2.7)
specinfra (~> 2.10)
syslog-logger (~> 1.6)
uuidtools (~> 2.1.5)
chef-config (12.9.38)
fuzzyurl (~> 0.8.0)
mixlib-config (~> 2.0)
mixlib-shellout (~> 2.0)
chef-zero (4.6.1)
ffi-yajl (~> 2.2)
hashie (>= 2.0, < 4.0)
mixlib-log (~> 1.3)
rack
uuidtools (~> 2.1)
chefspec (4.6.1)
chef (>= 11.14)
fauxhai (~> 3.2)
rspec (~> 3.0)
cleanroom (1.0.0)
cucumber-core (1.4.0)
gherkin (~> 3.2.0)
diff-lcs (1.2.5)
erubis (2.7.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
fauxhai (3.3.0)
net-ssh
ffi (1.9.10)
ffi-yajl (2.2.3)
libyajl2 (~> 1.2)
foodcritic (6.1.1)
cucumber-core (>= 1.3)
erubis
nokogiri (>= 1.5, < 2.0)
rake
rufus-lru (~> 1.0)
treetop (~> 1.4)
yajl-ruby (~> 1.1)
fuzzyurl (0.8.0)
gherkin (3.2.0)
hashie (3.4.3)
highline (1.7.8)
hitimes (1.2.3)
httpclient (2.7.1)
ipaddress (0.8.3)
json (1.8.3)
kitchen-vagrant (0.20.0)
test-kitchen (~> 1.4)
libyajl2 (1.2.0)
mini_portile2 (2.0.0)
minitar (0.5.4)
mixlib-authentication (1.4.0)
mixlib-log
rspec-core (~> 3.2)
rspec-expectations (~> 3.2)
rspec-mocks (~> 3.2)
mixlib-cli (1.5.0)
mixlib-config (2.2.1)
mixlib-install (1.0.7)
artifactory
mixlib-shellout
mixlib-versioning
mixlib-log (1.6.0)
mixlib-shellout (2.2.6)
mixlib-versioning (1.1.0)
molinillo (0.4.4)
multi_json (1.11.2)
multipart-post (2.0.0)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-sftp (2.1.2)
net-ssh (>= 2.6.5)
net-ssh (3.1.1)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
net-ssh-multi (1.2.1)
net-ssh (>= 2.6.5)
net-ssh-gateway (>= 1.2.0)
net-telnet (0.1.1)
nio4r (1.2.1)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
ohai (8.14.0)
chef-config (>= 12.5.0.alpha.1, < 13)
ffi (~> 1.9)
ffi-yajl (~> 2.2)
ipaddress
mixlib-cli
mixlib-config (~> 2.0)
mixlib-log
mixlib-shellout (~> 2.0)
plist (~> 3.1)
systemu (~> 2.6.4)
wmi-lite (~> 1.0)
parser (2.3.0.7)
ast (~> 2.2)
plist (3.2.0)
polyglot (0.3.5)
powerpack (0.1.1)
proxifier (1.0.3)
rack (1.6.4)
rainbow (2.1.0)
rake (11.1.2)
retryable (2.0.3)
ridley (4.5.0)
addressable
buff-config (~> 1.0)
buff-extensions (~> 1.0)
buff-ignore (~> 1.1)
buff-shell_out (~> 0.1)
celluloid (~> 0.16.0)
celluloid-io (~> 0.16.1)
chef-config (>= 12.5.0)
erubis
faraday (~> 0.9.0)
hashie (>= 2.0.2, < 4.0.0)
httpclient (~> 2.7)
json (>= 1.7.7)
mixlib-authentication (>= 1.3.0)
retryable (~> 2.0)
semverse (~> 1.1)
varia_model (~> 0.4.0)
rspec (3.4.0)
rspec-core (~> 3.4.0)
rspec-expectations (~> 3.4.0)
rspec-mocks (~> 3.4.0)
rspec-core (3.4.4)
rspec-support (~> 3.4.0)
rspec-expectations (3.4.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-its (1.2.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.4.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.4.0)
rspec-support (3.4.1)
rspec_junit_formatter (0.2.3)
builder (< 4)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (0.39.0)
parser (>= 2.3.0.7, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.7.5)
rufus-lru (1.0.5)
safe_yaml (1.0.4)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
faraday (~> 0.8, < 0.10)
semverse (1.2.1)
serverspec (2.31.1)
multi_json
rspec (~> 3.0)
rspec-its
specinfra (~> 2.53)
sfl (2.2)
solve (2.0.3)
molinillo (~> 0.4.2)
semverse (~> 1.1)
specinfra (2.56.1)
net-scp
net-ssh (>= 2.7, < 4.0)
net-telnet
sfl
syslog-logger (1.6.8)
systemu (2.6.5)
test-kitchen (1.7.3)
mixlib-install (~> 1.0, >= 1.0.4)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (~> 1.1)
net-ssh (>= 2.9, < 4.0)
safe_yaml (~> 1.0)
thor (~> 0.18)
thor (0.19.1)
timers (4.0.4)
hitimes
treetop (1.6.5)
polyglot (~> 0.3)
unicode-display_width (1.0.3)
uuidtools (2.1.5)
varia_model (0.4.1)
buff-extensions (~> 1.0)
hashie (>= 2.0.2, < 4.0.0)
wmi-lite (1.0.0)
yajl-ruby (1.2.1)
PLATFORMS
ruby
DEPENDENCIES
berkshelf (~> 4.0)
chefspec (~> 4.0)
chefstyle!
foodcritic (~> 6.0)
kitchen-vagrant (~> 0.11)
test-kitchen (~> 1.0)
BUNDLED WITH
1.11.2

View File

@ -1,13 +1,11 @@
travis: bundle berks all: delivery
bundle exec chefstyle -D
bundle exec foodcritic .
bundle exec rspec --color --format doc
integration: bundle berks travis: debug_version_info all
bundle exec kitchen test
bundle: debug_version_info:
bundle install /opt/chefdk/embedded/bin/chef --version
/opt/chefdk/embedded/bin/cookstyle --version
/opt/chefdk/embedded/bin/foodcritic --version
berks: delivery:
bundle exec berks install /opt/chefdk/bin/chef exec delivery local all

View File

@ -6,11 +6,22 @@ application specific logrotate configuration.
## Requirements ## Requirements
### Platforms
Should work on any platform that includes a 'logrotate' package and Should work on any platform that includes a 'logrotate' package and
writes logrotate configuration to /etc/logrotate.d. Tested on Ubuntu writes logrotate configuration to /etc/logrotate.d. Tested on Ubuntu
and Centos. and Centos.
### Chef
- Chef 12.5+
### Cookbooks
- none
## Recipes ## Recipes
### global ### global
@ -118,7 +129,7 @@ The resource takes the following properties:
"logrotate.erb". "logrotate.erb".
- `template_mode`: the mode to create the logrotate template with - `template_mode`: the mode to create the logrotate template with
(default: "0440") (default: "0644")
- `template_owner`: the owner of the logrotate template (default: - `template_owner`: the owner of the logrotate template (default:
"root") "root")

View File

@ -1,10 +1,10 @@
# #
# Cookbook Name:: logrotate # Cookbook:: logrotate
# Attribute:: default # Attribute:: default
# #
# Copyright 2013, Chef Software, Inc # Copyright:: 2013-2017, Chef Software, Inc
# Copyright 2015-2016, Steven Danna # Copyright:: 2015-2017, Steven Danna
# Copyright 2016, Bloomberg Finance L.P. # Copyright:: 2016-2017, Bloomberg Finance L.P.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -19,36 +19,37 @@
# limitations under the License. # limitations under the License.
# #
default["logrotate"]["package"] = { default['logrotate']['package'] = {
"name" => "logrotate", 'name' => 'logrotate',
"source" => nil, 'source' => nil,
"version" => nil, 'version' => nil,
"provider" => nil, 'provider' => nil,
'action' => :upgrade,
} }
default["logrotate"]["directory"] = "/etc/logrotate.d" default['logrotate']['directory'] = '/etc/logrotate.d'
default["logrotate"]["cron"]["install"] = platform?("solaris2") || platform?("aix") default['logrotate']['cron']['install'] = platform?('solaris2') || platform?('aix')
default["logrotate"]["cron"]["name"] = "logrotate" default['logrotate']['cron']['name'] = 'logrotate'
default["logrotate"]["cron"]["command"] = "/usr/sbin/logrotate /etc/logrotate.conf" default['logrotate']['cron']['command'] = '/usr/sbin/logrotate /etc/logrotate.conf'
default["logrotate"]["cron"]["minute"] = 35 default['logrotate']['cron']['minute'] = 35
default["logrotate"]["cron"]["hour"] = 2 default['logrotate']['cron']['hour'] = 2
default["logrotate"]["global"] = { default['logrotate']['global'] = {
"weekly" => true, 'weekly' => true,
"rotate" => 4, 'rotate' => 4,
"create" => "", 'create' => '',
"/var/log/wtmp" => { '/var/log/wtmp' => {
"missingok" => true, 'missingok' => true,
"monthly" => true, 'monthly' => true,
"create" => "0664 root utmp", 'create' => '0664 root utmp',
"rotate" => 1, 'rotate' => 1,
}, },
"/var/log/btmp" => { '/var/log/btmp' => {
"missingok" => true, 'missingok' => true,
"monthly" => true, 'monthly' => true,
"create" => "0660 root utmp", 'create' => '0660 root utmp',
"rotate" => 1, 'rotate' => 1,
}, },
} }

View File

@ -0,0 +1,102 @@
# Put files/directories that should be ignored in this file when uploading
# to a chef-server or supermarket.
# Lines that start with '# ' are comments.
# OS generated files #
######################
.DS_Store
Icon?
nohup.out
ehthumbs.db
Thumbs.db
# SASS #
########
.sass-cache
# EDITORS #
###########
\#*
.#*
*~
*.sw[a-z]
*.bak
REVISION
TAGS*
tmtags
*_flymake.*
*_flymake
*.tmproj
.project
.settings
mkmf.log
## COMPILED ##
##############
a.out
*.o
*.pyc
*.so
*.com
*.class
*.dll
*.exe
*/rdoc/
# Testing #
###########
.watchr
.rspec
spec/*
spec/fixtures/*
test/*
features/*
examples/*
Guardfile
Procfile
.kitchen*
.rubocop.yml
spec/*
Rakefile
.travis.yml
.foodcritic
.codeclimate.yml
# SCM #
#######
.git
*/.git
.gitignore
.gitmodules
.gitconfig
.gitattributes
.svn
*/.bzr/*
*/.hg/*
*/.svn/*
# Berkshelf #
#############
Berksfile
Berksfile.lock
cookbooks/*
tmp
# Cookbooks #
#############
CONTRIBUTING*
CHANGELOG*
TESTING*
MAINTAINERS.toml
# Strainer #
############
Colanderfile
Strainerfile
.colander
.strainer
# Vagrant #
###########
.vagrant
Vagrantfile

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: logrotate # Cookbook:: logrotate
# Library:: CookbookLogrotate # Library:: CookbookLogrotate
# #
# Copyright 2013, Chef # Copyright:: 2013-2017, Chef
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -19,24 +19,24 @@
# Helper module for Logrotate configuration module CookbookLogrotate # Helper module for Logrotate configuration module CookbookLogrotate
module CookbookLogrotate module CookbookLogrotate
DIRECTIVES = %w{compress copy copytruncate daily dateext DIRECTIVES = %w(compress copy copytruncate daily dateext
dateyesterday delaycompress hourly ifempty mailfirst maillast dateyesterday delaycompress hourly ifempty mailfirst maillast
missingok monthly nocompress nocopy nocopytruncate nocreate nocreateolddir missingok monthly nocompress nocopy nocopytruncate nocreate nocreateolddir
nodelaycompress nodateext nomail nomissingok noolddir nodelaycompress nodateext nomail nomissingok noolddir
nosharedscripts noshred notifempty renamecopy sharedscripts shred weekly nosharedscripts noshred notifempty renamecopy sharedscripts shred weekly
yearly} unless const_defined?(:DIRECTIVES) yearly).freeze unless const_defined?(:DIRECTIVES)
VALUES = %w{compresscmd uncompresscmd compressext compressoptions VALUES = %w(compresscmd uncompresscmd compressext compressoptions
create createolddir dateformat include mail extension maxage minsize maxsize create createolddir dateformat include mail extension maxage minsize maxsize
rotate size shredcycles start tabooext su olddir} unless const_defined?(:VALUES) rotate size shredcycles start tabooext su olddir).freeze unless const_defined?(:VALUES)
SCRIPTS = %w{firstaction prerotate postrotate lastaction preremove} unless const_defined?(:SCRIPTS) SCRIPTS = %w(firstaction prerotate postrotate lastaction preremove).freeze unless const_defined?(:SCRIPTS)
DIRECTIVES_AND_VALUES = DIRECTIVES + VALUES unless const_defined?(:DIRECTIVES_AND_VALUES) DIRECTIVES_AND_VALUES_AND_SCRIPTS = DIRECTIVES + VALUES + SCRIPTS unless const_defined?(:DIRECTIVES_AND_VALUES_AND_SCRIPTS)
# Helper class for creating configurations # Helper class for creating configurations
class LogrotateConfiguration class LogrotateConfiguration
attr_reader :directives, :values, :paths attr_reader :directives, :values, :scripts, :paths
class << self class << self
def from_hash(hash) def from_hash(hash)
@ -52,27 +52,23 @@ module CookbookLogrotate
end end
def paths_from(hash) def paths_from(hash)
hash.select { |k| !(DIRECTIVES_AND_VALUES.include?(k)) }.reduce({}) do |accum_paths, (path, config)| hash.select { |k| !DIRECTIVES_AND_VALUES_AND_SCRIPTS.include?(k) }.each_with_object({}) do |(path, config), accum_paths|
accum_paths[path] = { accum_paths[path] = {
"directives" => directives_from(config), 'directives' => directives_from(config),
"values" => values_from(config), 'values' => values_from(config),
"scripts" => scripts_from(config), 'scripts' => scripts_from(config),
} }
accum_paths
end end
end end
def scripts_from(hash) def scripts_from(hash)
defined_scripts = hash.select { |k| SCRIPTS.include?(k) } defined_scripts = hash.select { |k| SCRIPTS.include?(k) }
defined_scripts.reduce({}) do |accum_scripts, (script, lines)| defined_scripts.each_with_object({}) do |(script, lines), accum_scripts|
if lines.respond_to?(:join) accum_scripts[script] = if lines.respond_to?(:join)
accum_scripts[script] = lines.join("\n") lines.join("\n")
else else
accum_scripts[script] = lines lines
end end
accum_scripts
end end
end end
end end
@ -82,6 +78,7 @@ module CookbookLogrotate
def initialize(hash) def initialize(hash)
@directives = LogrotateConfiguration.directives_from(hash) @directives = LogrotateConfiguration.directives_from(hash)
@values = LogrotateConfiguration.values_from(hash) @values = LogrotateConfiguration.values_from(hash)
@scripts = LogrotateConfiguration.scripts_from(hash)
@paths = LogrotateConfiguration.paths_from(hash) @paths = LogrotateConfiguration.paths_from(hash)
end end
end end

View File

@ -1,4 +1,6 @@
if defined?(ChefSpec) if defined?(ChefSpec)
ChefSpec.define_matcher :logrotate_app
def enable_logrotate_app(resource) def enable_logrotate_app(resource)
ChefSpec::Matchers::ResourceMatcher.new(:logrotate_app, :enable, resource) ChefSpec::Matchers::ResourceMatcher.new(:logrotate_app, :enable, resource)
end end

View File

@ -16,7 +16,7 @@
"ubuntu": ">= 0.0.0" "ubuntu": ">= 0.0.0"
}, },
"dependencies": { "dependencies": {
"compat_resource": ">= 0.0.0"
}, },
"recommendations": { "recommendations": {
@ -42,12 +42,14 @@
"recipes": { "recipes": {
"logrotate": "Installs logrotate package" "logrotate": "Installs logrotate package"
}, },
"version": "2.1.0", "version": "2.2.0",
"source_url": "https://github.com/stevendanna/logrotate", "source_url": "https://github.com/stevendanna/logrotate",
"issues_url": "https://github.com/stevendanna/logrotate/issues", "issues_url": "https://github.com/stevendanna/logrotate/issues",
"privacy": false, "privacy": false,
"chef_versions": [ "chef_versions": [
[
">= 12.5"
]
], ],
"ohai_versions": [ "ohai_versions": [

View File

@ -1,19 +1,18 @@
name "logrotate" name 'logrotate'
maintainer "Steven Danna" maintainer 'Steven Danna'
maintainer_email "steve@chef.io" maintainer_email 'steve@chef.io'
license "Apache 2.0" license 'Apache 2.0'
description "Installs logrotate package and provides a definition for logrotate configs" description 'Installs logrotate package and provides a definition for logrotate configs'
long_description "Installs the logrotate package, manages /etc/logrotate.conf, and provides a logrotate_app definition." long_description 'Installs the logrotate package, manages /etc/logrotate.conf, and provides a logrotate_app definition.'
version "2.1.0" version '2.2.0'
source_url "https://github.com/stevendanna/logrotate" if respond_to?(:source_url) recipe 'logrotate', 'Installs logrotate package'
issues_url "https://github.com/stevendanna/logrotate/issues" if respond_to?(:issues_url) provides 'logrotate_app'
recipe "logrotate", "Installs logrotate package" %w(amazon centos debian fedora redhat scientific solaris2 ubuntu).each do |platform|
provides "logrotate_app"
depends "compat_resource"
%w{amazon centos debian fedora redhat scientific solaris2 ubuntu}.each do |platform|
supports platform supports platform
end end
source_url 'https://github.com/stevendanna/logrotate'
issues_url 'https://github.com/stevendanna/logrotate/issues'
chef_version '>= 12.5' if respond_to?(:chef_version)

View File

@ -1,10 +1,10 @@
# #
# Cookbook Name:: logrotate # Cookbook:: logrotate
# Recipe:: default # Recipe:: default
# #
# Copyright 2009-2013, Chef Software, Inc. # Copyright:: 2009-2017, Chef Software, Inc.
# Copyright 2015-2016, Steven Danna # Copyright:: 2015-2017, Steven Danna
# Copyright 2016, Bloomberg Finance L.P. # Copyright:: 2016-2017, Bloomberg Finance L.P.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -18,25 +18,25 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
return if platform?("windows") return if platform?('windows')
package node["logrotate"]["package"]["name"] do package node['logrotate']['package']['name'] do
provider node["logrotate"]["package"]["provider"] if node["logrotate"]["package"]["provider"] provider node['logrotate']['package']['provider'] if node['logrotate']['package']['provider']
source node["logrotate"]["package"]["source"] if node["logrotate"]["package"]["source"] source node['logrotate']['package']['source'] if node['logrotate']['package']['source']
version node["logrotate"]["package"]["version"] if node["logrotate"]["package"]["version"] version node['logrotate']['package']['version'] if node['logrotate']['package']['version']
action :upgrade action node['logrotate']['package']['action']
end end
directory node["logrotate"]["directory"] do directory node['logrotate']['directory'] do
owner "root" owner 'root'
group node["root_group"] group node['root_group']
mode "0755" mode '0755'
end end
if node["logrotate"]["cron"]["install"] # ~FC023 if node['logrotate']['cron']['install'] # ~FC023
cron node["logrotate"]["cron"]["name"] do cron node['logrotate']['cron']['name'] do
minute node["logrotate"]["cron"]["minute"] minute node['logrotate']['cron']['minute']
hour node["logrotate"]["cron"]["hour"] hour node['logrotate']['cron']['hour']
command node["logrotate"]["cron"]["command"] command node['logrotate']['cron']['command']
end end
end end

View File

@ -1,8 +1,8 @@
# #
# Cookbook Name:: logrotate # Cookbook:: logrotate
# Recipe:: default # Recipe:: default
# #
# Copyright 2009-2013, Chef Software, Inc. # Copyright:: 2009-2017, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,14 +17,14 @@
# limitations under the License. # limitations under the License.
# #
include_recipe "logrotate::default" include_recipe 'logrotate::default'
parsed_configuration = CookbookLogrotate::LogrotateConfiguration.from_hash(node["logrotate"]["global"].to_hash) parsed_configuration = CookbookLogrotate::LogrotateConfiguration.from_hash(node['logrotate']['global'].to_hash)
template "/etc/logrotate.conf" do template '/etc/logrotate.conf' do
source "logrotate-global.erb" source 'logrotate-global.erb'
mode "0644" mode '0644'
variables( variables(
:configuration => parsed_configuration configuration: parsed_configuration
) )
end end

View File

@ -1,5 +1,5 @@
# #
# Copyright 2016, Steven Danna # Copyright:: 2016-2017, Steven Danna
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -17,20 +17,20 @@
resource_name :logrotate_app resource_name :logrotate_app
property :path, [String, Array], required: true property :path, [String, Array], required: true
property :frequency, String, default: "weekly" property :frequency, String, default: 'weekly'
property :cookbook, default: "logrotate" property :cookbook, default: 'logrotate'
property :template_name, default: "logrotate.erb" property :template_name, default: 'logrotate.erb'
property :template_mode, default: "0644" property :template_mode, default: '0644'
property :template_owner, default: "root" property :template_owner, default: 'root'
property :template_group, default: "root" property :template_group, default: 'root'
property :base_dir, String, default: "/etc/logrotate.d" property :base_dir, String, default: '/etc/logrotate.d'
property :options, [Array, String], default: %w{missingok compress delaycompress copytruncate notifempty} property :options, [Array, String], default: %w(missingok compress delaycompress copytruncate notifempty)
default_action :enable default_action :enable
CookbookLogrotate::SCRIPTS.each do |script_name| CookbookLogrotate::SCRIPTS.each do |script_name|
property script_name.to_sym, coerce: Proc.new { |val| Array(val).join("\n") } property script_name.to_sym, coerce: proc { |val| Array(val).join("\n") }
end end
CookbookLogrotate::VALUES.each do |configurable_name| CookbookLogrotate::VALUES.each do |configurable_name|
@ -42,15 +42,15 @@ property :sharedscripts, [TrueClass, FalseClass], default: false
property :enable, [TrueClass, FalseClass], default: true property :enable, [TrueClass, FalseClass], default: true
action :enable do action :enable do
if !new_resource.enable unless new_resource.enable
Chef::Log.deprecation "Use `action :disable` rather than `enable false` in the logrotate_app resource" Chef::Log.deprecation 'Use `action :disable` rather than `enable false` in the logrotate_app resource'
action_disable action_disable
return true return true
end end
logrotate_config = { logrotate_config = {
# The path should be a space separated list of quoted filesystem paths # The path should be a space separated list of quoted filesystem paths
path: Array(new_resource.path).map { |path| path.to_s.inspect }.join(" "), path: Array(new_resource.path).map { |path| path.to_s.inspect }.join(' '),
frequency: new_resource.frequency, frequency: new_resource.frequency,
directives: handle_options(new_resource), directives: handle_options(new_resource),
scripts: handle_scripts(new_resource), scripts: handle_scripts(new_resource),
@ -58,9 +58,9 @@ action :enable do
} }
directory new_resource.base_dir do directory new_resource.base_dir do
owner "root" owner 'root'
group node["root_group"] group node['root_group']
mode "0755" mode '0755'
action :create action :create
end end
@ -84,7 +84,7 @@ end
def handle_configurables(new_resource) def handle_configurables(new_resource)
configurables = {} configurables = {}
CookbookLogrotate::VALUES.each do |opt_name| CookbookLogrotate::VALUES.each do |opt_name|
if value = new_resource.send(opt_name.to_sym) if value = new_resource.send(opt_name.to_sym) # rubocop: disable Lint/AssignmentInCondition
configurables[opt_name] = value configurables[opt_name] = value
end end
end end
@ -94,7 +94,7 @@ end
def handle_scripts(new_resource) def handle_scripts(new_resource)
scripts = {} scripts = {}
CookbookLogrotate::SCRIPTS.each do |script_name| CookbookLogrotate::SCRIPTS.each do |script_name|
if script_body = new_resource.send(script_name.to_sym) if script_body = new_resource.send(script_name.to_sym) # rubocop: disable Lint/AssignmentInCondition
scripts[script_name] = script_body scripts[script_name] = script_body
end end
end end
@ -109,8 +109,8 @@ def handle_options(new_resource)
end end
if new_resource.sharedscripts if new_resource.sharedscripts
Chef::Log.deprecation("The sharedscripts resource property is deprecated. Use the options property instead to set this value") Chef::Log.deprecation('The sharedscripts resource property is deprecated. Use the options property instead to set this value')
opts << "sharedscripts" opts << 'sharedscripts'
end end
opts opts
end end

View File

@ -9,6 +9,12 @@
<%= k %> <%= v %> <%= k %> <%= v %>
<% end -%> <% end -%>
<% @configuration.scripts.each do | scripttype, body | -%>
<%= scripttype %>
<%= body %>
endscript
<% end -%>
include /etc/logrotate.d include /etc/logrotate.d
<% @configuration.paths.each do |path, path_config| -%> <% @configuration.paths.each do |path, path_config| -%>

View File

@ -2,6 +2,20 @@
This file is used to list changes made in each version of the mysql cookbook. This file is used to list changes made in each version of the mysql cookbook.
## 8.4.0 (2017-05-30)
- Fix client/server install on Amazon Linux and add testing
- Remove support for Ubuntu Precise since it's EOL
- Add Amazon Linux testing
## 8.3.1 (2017-04-04)
- Fix an ignoring of 'cookbook' attribute by 'mysql_config' resource
- Remove unused helper method
- Call out the supported platform versions in the metadata
- Switch to Delivery Local and rename the docked config
- Remove mention of the EOL opensuse 13.x in the readme
## 8.3.0 (2017-03-20) ## 8.3.0 (2017-03-20)
- Refactor mysql_service_manager_upstart.rb to eliminate use of cloned resource - Refactor mysql_service_manager_upstart.rb to eliminate use of cloned resource

View File

@ -36,8 +36,6 @@ The following platforms have been tested with Test Kitchen:
|----------------+-----+-----+-----+-----| |----------------+-----+-----+-----+-----|
| fedora | | | X | X | | fedora | | | X | X |
|----------------+-----+-----+-----+-----| |----------------+-----+-----+-----+-----|
| openSUSE 13.2 | | | X | |
|----------------+-----+-----+-----+-----|
| openSUSE Leap | | | X | | | openSUSE Leap | | | X | |
|----------------+-----+-----+-----+-----| |----------------+-----+-----+-----+-----|
``` ```

View File

@ -22,11 +22,6 @@ module MysqlCookbook
false false
end end
def precise?
return true if node['platform'] == 'ubuntu' && node['platform_version'] == '12.04'
false
end
def trusty? def trusty?
return true if node['platform'] == 'ubuntu' && node['platform_version'] == '14.04' return true if node['platform'] == 'ubuntu' && node['platform_version'] == '14.04'
return true if node['platform'] == 'linuxmint' && node['platform_version'] =~ /^17\.[0-9]$/ return true if node['platform'] == 'linuxmint' && node['platform_version'] =~ /^17\.[0-9]$/
@ -60,14 +55,13 @@ module MysqlCookbook
# rhelish # rhelish
return '5.1' if el6? return '5.1' if el6?
return '5.6' if el7? return '5.6' if el7?
return '5.5' if node['platform'] == 'amazon' return '5.6' if node['platform'] == 'amazon'
# debian # debian
return '5.5' if wheezy? return '5.5' if wheezy?
return '5.5' if jessie? return '5.5' if jessie?
# ubuntu # ubuntu
return '5.5' if precise?
return '5.5' if trusty? return '5.5' if trusty?
return '5.7' if xenial? return '5.7' if xenial?
@ -91,6 +85,8 @@ module MysqlCookbook
def default_client_package_name def default_client_package_name
return ['mysql', 'mysql-devel'] if major_version == '5.1' && el6? return ['mysql', 'mysql-devel'] if major_version == '5.1' && el6?
return ['mysql55', 'mysql55-devel.x86_64'] if major_version == '5.5' && node['platform'] == 'amazon'
return ['mysql56', 'mysql56-devel.x86_64'] if major_version == '5.6' && node['platform'] == 'amazon'
return ['mysql-client-5.5', 'libmysqlclient-dev'] if major_version == '5.5' && node['platform_family'] == 'debian' return ['mysql-client-5.5', 'libmysqlclient-dev'] if major_version == '5.5' && node['platform_family'] == 'debian'
return ['mysql-client-5.6', 'libmysqlclient-dev'] if major_version == '5.6' && node['platform_family'] == 'debian' return ['mysql-client-5.6', 'libmysqlclient-dev'] if major_version == '5.6' && node['platform_family'] == 'debian'
return ['mysql-client-5.7', 'libmysqlclient-dev'] if major_version == '5.7' && node['platform_family'] == 'debian' return ['mysql-client-5.7', 'libmysqlclient-dev'] if major_version == '5.7' && node['platform_family'] == 'debian'
@ -100,6 +96,8 @@ module MysqlCookbook
def default_server_package_name def default_server_package_name
return 'mysql-server' if major_version == '5.1' && el6? return 'mysql-server' if major_version == '5.1' && el6?
return 'mysql55-server' if major_version == '5.5' && node['platform'] == 'amazon'
return 'mysql56-server' if major_version == '5.6' && node['platform'] == 'amazon'
return 'mysql-server-5.5' if major_version == '5.5' && node['platform_family'] == 'debian' return 'mysql-server-5.5' if major_version == '5.5' && node['platform_family'] == 'debian'
return 'mysql-server-5.6' if major_version == '5.6' && node['platform_family'] == 'debian' return 'mysql-server-5.6' if major_version == '5.6' && node['platform_family'] == 'debian'
return 'mysql-server-5.7' if major_version == '5.7' && node['platform_family'] == 'debian' return 'mysql-server-5.7' if major_version == '5.7' && node['platform_family'] == 'debian'
@ -284,9 +282,5 @@ EOSQL
return "scl enable #{scl_name} \"#{cmd}\"" if scl_package? return "scl enable #{scl_name} \"#{cmd}\"" if scl_package?
cmd cmd
end end
def sensitive_supported?
Gem::Version.new(Chef::VERSION) >= Gem::Version.new('11.14.0')
end
end end
end end

View File

@ -42,7 +42,7 @@ module MysqlCookbook
mode '0640' mode '0640'
variables(new_resource.variables) variables(new_resource.variables)
source new_resource.source source new_resource.source
cookbook cookbook cookbook new_resource.cookbook
action :create action :create
end end
end end

View File

@ -1 +1 @@
{"name":"mysql","version":"8.3.0","description":"Provides mysql_service, mysql_config, and mysql_client resources","long_description":"","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache 2.0","platforms":{"amazon":">= 0.0.0","redhat":">= 0.0.0","centos":">= 0.0.0","scientific":">= 0.0.0","oracle":">= 0.0.0","fedora":">= 0.0.0","debian":">= 0.0.0","ubuntu":">= 0.0.0","suse":">= 0.0.0","opensuse":">= 0.0.0","opensuseleap":">= 0.0.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chef-cookbooks/mysql","issues_url":"https://github.com/chef-cookbooks/mysql/issues","chef_version":">= 12.1","ohai_version":{}} {"name":"mysql","version":"8.4.0","description":"Provides mysql_service, mysql_config, and mysql_client resources","long_description":"","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache-2.0","platforms":{"redhat":">= 6.0","centos":">= 6.0","scientific":">= 6.0","oracle":">= 6.0","amazon":">= 0.0.0","fedora":">= 0.0.0","debian":">= 7.0","ubuntu":">= 12.04","opensuse":">= 13.0","opensuseleap":">= 0.0.0","suse":">= 12.0"},"dependencies":{},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{},"source_url":"https://github.com/chef-cookbooks/mysql","issues_url":"https://github.com/chef-cookbooks/mysql/issues","chef_version":[[">= 12.1"]],"ohai_version":[]}

View File

@ -2,6 +2,12 @@
This file is used to list changes made in each version of the openssl cookbook. This file is used to list changes made in each version of the openssl cookbook.
## 7.1.0 (2017-05-30)
- Add supported platforms to the metdata
- Fix amazon support
- Remove class_eval usage and require Chef 12.7+
## 7.0.1 (2017-03-21) ## 7.0.1 (2017-03-21)
- Fix compatibility with Chef 12.5.1 - Fix compatibility with Chef 12.5.1

View File

@ -25,7 +25,7 @@ The `upgrade` recipe has been tested on the following platforms:
## Chef ## Chef
- Chef 12.5+ - Chef 12.7+
## Cookbooks ## Cookbooks

File diff suppressed because one or more lines are too long

View File

@ -20,7 +20,7 @@
case node['platform_family'] case node['platform_family']
when 'debian', 'ubuntu' when 'debian', 'ubuntu'
packages = %w(libssl1.0.0 openssl) packages = %w(libssl1.0.0 openssl)
when 'rhel', 'fedora', 'suse' when 'rhel', 'fedora', 'suse', 'amazon'
packages = %w(openssl) packages = %w(openssl)
else else
packages = [] packages = []

View File

@ -42,7 +42,7 @@ action :create do
end end
end end
action_class.class_eval do action_class do
def generate_key_file def generate_key_file
unless new_resource.key_file unless new_resource.key_file
path, file = ::File.split(new_resource.name) path, file = ::File.split(new_resource.name)

View File

@ -1,3 +1,5 @@
[![Build Status](https://travis-ci.org/yevgenko/cookbook-php-fpm.svg?branch=master)](https://travis-ci.org/yevgenko/cookbook-php-fpm)
Description Description
=========== ===========

View File

@ -10,7 +10,7 @@ when "rhel", "fedora"
else else
user = "www-data" user = "www-data"
group = "www-data" group = "www-data"
if platform?('ubuntu') and node.platform_version.to_f >= 16.04 if platform?('ubuntu') and node['platform_version'].to_f >= 16.04
php_conf_dir = "/etc/php/7.0" php_conf_dir = "/etc/php/7.0"
php_fpm_name = "php7.0-fpm" php_fpm_name = "php7.0-fpm"
else else
@ -19,7 +19,7 @@ else
end end
conf_dir = "#{php_conf_dir}/fpm/conf.d" conf_dir = "#{php_conf_dir}/fpm/conf.d"
pool_conf_dir = "#{php_conf_dir}/fpm/pool.d" pool_conf_dir = "#{php_conf_dir}/fpm/pool.d"
if node.platform == "ubuntu" and node.platform_version.to_f <= 10.04 if node['platform'] == "ubuntu" and node['platform_version'].to_f <= 10.04
conf_file = "#{php_conf_dir}/fpm/php5-fpm.conf" conf_file = "#{php_conf_dir}/fpm/php5-fpm.conf"
else else
conf_file = "#{php_conf_dir}/fpm/php-fpm.conf" conf_file = "#{php_conf_dir}/fpm/php-fpm.conf"

View File

@ -1,8 +1,8 @@
{ {
"name": "php-fpm", "name": "php-fpm",
"version": "0.7.8", "version": "0.7.9",
"description": "Installs/Configures php-fpm", "description": "Installs/Configures php-fpm",
"long_description": "Description\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", "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": "Opscode, Inc.",
"maintainer_email": "cookbooks@opscode.com", "maintainer_email": "cookbooks@opscode.com",
"license": "Apache 2.0", "license": "Apache 2.0",

View File

@ -38,7 +38,7 @@ when 'debian'
# Configure Dotdeb repos # Configure Dotdeb repos
# TODO: move this to it's own 'dotdeb' cookbook? # TODO: move this to it's own 'dotdeb' cookbook?
# http://www.dotdeb.org/instructions/ # http://www.dotdeb.org/instructions/
if node.platform_version.to_f >= 8.0 if node['platform_version'].to_f >= 8.0
apt_repository "dotdeb" do apt_repository "dotdeb" do
uri node['php-fpm']['dotdeb_repository']['uri'] uri node['php-fpm']['dotdeb_repository']['uri']
distribution "jessie" distribution "jessie"
@ -46,7 +46,7 @@ when 'debian'
key node['php-fpm']['dotdeb_repository']['key'] key node['php-fpm']['dotdeb_repository']['key']
action :add action :add
end end
elsif node.platform_version.to_f >= 7.0 elsif node['platform_version'].to_f >= 7.0
apt_repository "dotdeb" do apt_repository "dotdeb" do
uri node['php-fpm']['dotdeb_repository']['uri'] uri node['php-fpm']['dotdeb_repository']['uri']
distribution "wheezy" distribution "wheezy"
@ -54,7 +54,7 @@ when 'debian'
key node['php-fpm']['dotdeb_repository']['key'] key node['php-fpm']['dotdeb_repository']['key']
action :add action :add
end end
elsif node.platform_version.to_f >= 6.0 elsif node['platform_version'].to_f >= 6.0
apt_repository "dotdeb" do apt_repository "dotdeb" do
uri node['php-fpm']['dotdeb_repository']['uri'] uri node['php-fpm']['dotdeb_repository']['uri']
distribution "squeeze" distribution "squeeze"

View File

@ -2,7 +2,42 @@
This file is used to list changes made in each version of the php cookbook. This file is used to list changes made in each version of the php cookbook.
## 4.2.0 (2017-05-30)
- Make sure package intalls, php-fpm, and source installs work on Amazon linux
- Avoid symlink warning in the converges
- Simplify the package install logic
- Rename the inspec test to match the suite name so it actually runs
- Test on FreeBSD 11 / Amazon Linux
- Install 5.6.30 by default on source installs
## 4.1.0 (2017-05-30)
- Remove class_eval usage and require Chef 12.7+
## 4.0.0 (2017-04-20)
- Fix pear_channel resource to not fail on Chef 12.5 and 12.6
- Remove support for RHEL 5 as it is now EOL
- Resolve Amazon Linux failures on Chef 13
- Convert fpm_pool to a custom resource
- Fix php_pear failures on Chef 13
- Remove non-functional support for Windows
- Remove redundant Ubuntu version checks in the php_pear provider
- Expand testing to test all of the resources
## 3.1.1 (2017-04-20)
- Use the cookbook attribute as the default value of pear_channel pear property to provide better platform support
## 3.1.0 (2017-04-10)
- Use multi-package installs on supported platform_family(rhel debian suse amazon)
- Use a SPDX standardized license string in the metadata
- Update specs for the new Fauxhai data
## 3.0.0 (2017-03-27) ## 3.0.0 (2017-03-27)
- Converted pear_channel LWRP into custom resource - Converted pear_channel LWRP into custom resource
- Removed use of pear node attribute from pear_channel resource - Removed use of pear node attribute from pear_channel resource
- Fix cookstyle issue with missing line on metadata.rb - Fix cookstyle issue with missing line on metadata.rb
@ -10,7 +45,8 @@ This file is used to list changes made in each version of the php cookbook.
- Eliminate duplicated resource from test cookbook that is in the default recipe. - Eliminate duplicated resource from test cookbook that is in the default recipe.
- Rename php-test to standard cookbook testing cookbook of "test" - Rename php-test to standard cookbook testing cookbook of "test"
- Remove EOL ubuntu platform logic - Remove EOL ubuntu platform logic
**NOTE** Windows package installation is currently broken.
**NOTE** Windows package installation is currently broken.
## 2.2.1 (2017-02-21) ## 2.2.1 (2017-02-21)

View File

@ -1,48 +1,58 @@
# php Cookbook # php Cookbook
[![Build Status](https://travis-ci.org/chef-cookbooks/php.svg?branch=master)](http://travis-ci.org/chef-cookbooks/php) [![Cookbook Version](https://img.shields.io/cookbook/v/php.svg)](https://supermarket.chef.io/cookbooks/php) [![Build Status](https://travis-ci.org/chef-cookbooks/php.svg?branch=master)](http://travis-ci.org/chef-cookbooks/php) [![Cookbook Version](https://img.shields.io/cookbook/v/php.svg)](https://supermarket.chef.io/cookbooks/php)
It installs and configures PHP and the PEAR package management system. Also includes resources for managing PEAR (and PECL) packages, PECL channels, and PHP-FPM pools. It installs and configures PHP and the PEAR package management system. Also includes resources for managing PEAR (and PECL) packages, PECL channels, and PHP-FPM pools.
## Requirements ## Requirements
### Platforms ### Platforms
- Debian, Ubuntu - Debian, Ubuntu
- CentOS, Red Hat, Oracle, Scientific, Amazon Linux - CentOS, Red Hat, Oracle, Scientific, Amazon Linux
- Fedora - Fedora
- Microsoft Windows
### Chef ### Chef
- Chef 12.1+
- Chef 12.7+
### Cookbooks ### Cookbooks
- build-essential - build-essential
- xml - xml
- mysql - mysql
- iis
- windows
## Attributes ## Attributes
- `node['php']['install_method']` = method to install php with, default `package`. - `node['php']['install_method']` = method to install php with, default `package`.
- `node['php']['directives']` = Hash of directives and values to append to `php.ini`, default `{}`. - `node['php']['directives']` = Hash of directives and values to append to `php.ini`, default `{}`.
- `node['php']['pear']` = Name of the pear executable to use, default `pear`.
The file also contains the following attribute types: The file also contains the following attribute types:
- platform specific locations and settings. - platform specific locations and settings.
- source installation settings - source installation settings
## Resource/Provider ## Resource/Provider
This cookbook includes LWRPs for managing: This cookbook includes LWRPs for managing:
- PEAR channels - PEAR channels
- PEAR/PECL packages - PEAR/PECL packages
### `php_pear_channel` ### `php_pear_channel`
[PEAR Channels](http://pear.php.net/manual/en/guide.users.commandline.channels.php) are alternative sources for PEAR packages. This resource provides and easy way to manage these channels.
[PEAR Channels](http://pear.php.net/manual/en/guide.users.commandline.channels.php) are alternative sources for PEAR packages. This resource provides and easy way to manage these channels.
#### Actions #### Actions
- :discover: Initialize a channel from its server. - :discover: Initialize a channel from its server.
- :add: Add a channel to the channel list, usually only used to add private channels. Public channels are usually added using the `:discover` action - :add: Add a channel to the channel list, usually only used to add private channels. Public channels are usually added using the `:discover` action
- :update: Update an existing channel - :update: Update an existing channel
- :remove: Remove a channel from the List - :remove: Remove a channel from the List
#### Attribute Parameters #### Attribute Parameters
- channel_name: name attribute. The name of the channel to discover - channel_name: name attribute. The name of the channel to discover
- channel_xml: the channel.xml file of the channel you are adding - channel_xml: the channel.xml file of the channel you are adding
- pear: pear binary, default: pear - pear: pear binary, default: pear
@ -77,17 +87,20 @@ end
``` ```
### `php_pear` ### `php_pear`
[PEAR](http://pear.php.net/) is a framework and distribution system for reusable PHP components. [PECL](http://pecl.php.net/) is a repository for PHP Extensions. PECL contains C extensions for compiling into PHP. As C programs, PECL extensions run more efficiently than PEAR packages. PEARs and PECLs use the same packaging and distribution system. As such this LWRP is clever enough to abstract away the small differences and can be used for managing either. This LWRP also creates the proper module .ini file for each PECL extension at the correct location for each supported platform.
[PEAR](http://pear.php.net/) is a framework and distribution system for reusable PHP components. [PECL](http://pecl.php.net/) is a repository for PHP Extensions. PECL contains C extensions for compiling into PHP. As C programs, PECL extensions run more efficiently than PEAR packages. PEARs and PECLs use the same packaging and distribution system. As such this LWRP is clever enough to abstract away the small differences and can be used for managing either. This LWRP also creates the proper module .ini file for each PECL extension at the correct location for each supported platform.
#### Actions #### Actions
- `:install`: Install a pear package - if version is provided, install that specific version - `:install`: Install a pear package - if version is provided, install that specific version
- `:upgrade`: Upgrade a pear package - if version is provided, upgrade to that specific version - `:upgrade`: Upgrade a pear package - if version is provided, upgrade to that specific version
- `:remove`: Remove a pear package - `:remove`: Remove a pear package
- `:purge`: Purge a pear package (this usually entails removing configuration files as well as the package itself). With pear packages this behaves the same as `:remove` - `:purge`: Purge a pear package (this usually entails removing configuration files as well as the package itself). With pear packages this behaves the same as `:remove`
#### Attribute Parameters #### Attribute Parameters
- `package_name`: name attribute. The name of the pear package to install - `package_name`: name attribute. The name of the pear package to install
- version: the version of the pear package to install/upgrade. If no version is given latest is assumed. - version: the version of the pear package to install/upgrade. If no version is given latest is assumed.
- `preferred_state`: PEAR by default installs stable packages only, this allows you to install pear packages in a devel, alpha or beta state - `preferred_state`: PEAR by default installs stable packages only, this allows you to install pear packages in a devel, alpha or beta state
- `directives`: extra extension directives (settings) for a pecl. on most platforms these usually get rendered into the extension's .ini file - `directives`: extra extension directives (settings) for a pecl. on most platforms these usually get rendered into the extension's .ini file
- `zend_extensions`: extension filenames which should be loaded with zend_extension. - `zend_extensions`: extension filenames which should be loaded with zend_extension.
@ -152,22 +165,25 @@ end
``` ```
### `php_fpm_pool` ### `php_fpm_pool`
Installs the `php-fpm` package appropriate for your distro (if using packages) and configures a FPM pool for you. Currently only supported in Debian-family operating systems and CentOS 7 (or at least tested with such, YMMV if you are using source). Installs the `php-fpm` package appropriate for your distro (if using packages) and configures a FPM pool for you. Currently only supported in Debian-family operating systems and CentOS 7 (or at least tested with such, YMMV if you are using source).
Please consider FPM functionally pre-release, and test it thoroughly in your environment before using it in production Please consider FPM functionally pre-release, and test it thoroughly in your environment before using it in production
More info: [http://php.net/manual/en/install.fpm.php](http://php.net/manual/en/install.fpm.php) More info: <http://php.net/manual/en/install.fpm.php>
#### Actions #### Actions
- `:install`: Installs the FPM pool (default). - `:install`: Installs the FPM pool (default).
- `:uninstall`: Removes the FPM pool. - `:uninstall`: Removes the FPM pool.
#### Attribute Parameters #### Attribute Parameters
- `pool_name`: name attribute. The name of the FPM pool. - `pool_name`: name attribute. The name of the FPM pool.
- `listen`: The listen address. Default: `/var/run/php5-fpm.sock` - `listen`: The listen address. Default: `/var/run/php5-fpm.sock`
- `user`: The user to run the FPM under. Default should be the webserver user for your distro. - `user`: The user to run the FPM under. Default should be the webserver user for your distro.
- `group`: The group to run the FPM under. Default should be the webserver group for your distro. - `group`: The group to run the FPM under. Default should be the webserver group for your distro.
- `process_manager`: Process manager to use - see [http://php.net/manual/en/install.fpm.configuration.php](http://php.net/manual/en/install.fpm.configuration.php). Default: `dynamic` - `process_manager`: Process manager to use - see <http://php.net/manual/en/install.fpm.configuration.php>. Default: `dynamic`
- `max_children`: Max children to scale to. Default: 5 - `max_children`: Max children to scale to. Default: 5
- `start_servers`: Number of servers to start the pool with. Default: 2 - `start_servers`: Number of servers to start the pool with. Default: 2
- `min_spare_servers`: Minimum number of servers to have as spares. Default: 1 - `min_spare_servers`: Minimum number of servers to have as spares. Default: 1
@ -185,17 +201,23 @@ end
``` ```
## Recipes ## Recipes
### default ### default
Include the default recipe in a run list, to get `php`. By default `php` is installed from packages but this can be changed by using the `install_method` attribute.
Include the default recipe in a run list, to get `php`. By default `php` is installed from packages but this can be changed by using the `install_method` attribute.
### package ### package
This recipe installs PHP from packages. This recipe installs PHP from packages.
### source ### source
This recipe installs PHP from source. This recipe installs PHP from source.
## Deprecated Recipes ## Deprecated Recipes
The following recipes are deprecated and will be removed from a future version of this cookbook. The following recipes are deprecated and will be removed from a future version of this cookbook.
- `module_apc` - `module_apc`
- `module_apcu` - `module_apcu`
- `module_curl` - `module_curl`
@ -209,7 +231,7 @@ The following recipes are deprecated and will be removed from a future version o
- `module_pgsql` - `module_pgsql`
- `module_sqlite3` - `module_sqlite3`
The installation of the php modules in these recipes can now be accomplished by installing from a native package or via the new php_pear LWRP. For example, the functionality of the `module_memcache` recipe can be enabled in the following ways: The installation of the php modules in these recipes can now be accomplished by installing from a native package or via the new php_pear LWRP. For example, the functionality of the `module_memcache` recipe can be enabled in the following ways:
```ruby ```ruby
# using apt # using apt
@ -224,9 +246,10 @@ end
``` ```
## Usage ## Usage
Simply include the `php` recipe where ever you would like php installed. To install from source override the `node['php']['install_method']` attribute with in a role or wrapper cookbook:
####Role example: Simply include the `php` recipe where ever you would like php installed. To install from source override the `node['php']['install_method']` attribute with in a role or wrapper cookbook:
### Role example:
```ruby ```ruby
name "php" name "php"
@ -242,6 +265,7 @@ run_list(
``` ```
## License & Authors ## License & Authors
**Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io)) **Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io))
**Copyright:** 2008-2017, Chef Software, Inc. **Copyright:** 2008-2017, Chef Software, Inc.
@ -259,83 +283,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
``` ```
Note: This cookbook contains a modified copy of `go-phar.pear` for use on the Microsoft Windows platform only to correct an (upstream bug)[[http://pear.php.net/bugs/bug.php?id=16644](http://pear.php.net/bugs/bug.php?id=16644)]. The original `go-pear.phar` is licensed under the (PHP License version 2.02)[[http://www.php.net/license/2_02.txt](http://www.php.net/license/2_02.txt)]:
```
--------------------------------------------------------------------
The PHP License, version 2.02
Copyright (c) 1999 - 2002 The PHP Group. All rights reserved.
--------------------------------------------------------------------
Redistribution and use in source and binary forms, with or without
modification, is permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
3. The name "PHP" must not be used to endorse or promote products
derived from this software without prior permission from the
PHP Group. This does not apply to add-on libraries or tools
that work in conjunction with PHP. In such a case the PHP
name may be used to indicate that the product supports PHP.
4. The PHP Group may publish revised and/or new versions of the
license from time to time. Each version will be given a
distinguishing version number.
Once covered code has been published under a particular version
of the license, you may always continue to use it under the
terms of that version. You may also choose to use such covered
code under the terms of any subsequent version of the license
published by the PHP Group. No one other than the PHP Group has
the right to modify the terms applicable to covered code created
under this License.
5. Redistributions of any form whatsoever must retain the following
acknowledgment:
"This product includes PHP, freely available from
http://www.php.net/".
6. The software incorporates the Zend Engine, a product of Zend
Technologies, Ltd. ("Zend"). The Zend Engine is licensed to the
PHP Association (pursuant to a grant from Zend that can be
found at http://www.php.net/license/ZendGrant/) for
distribution to you under this license agreement, only as a
part of PHP. In the event that you separate the Zend Engine
(or any portion thereof) from the rest of the software, or
modify the Zend Engine, or any portion thereof, your use of the
separated or modified Zend Engine software shall not be governed
by this license, and instead shall be governed by the license
set forth at http://www.zend.com/license/ZendLicense/.
THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------
This software consists of voluntary contributions made by many
individuals on behalf of the PHP Group.
The PHP Group can be contacted via Email at group@php.net.
For more information on the PHP Group and the PHP project,
please see <http://www.php.net>.
```

View File

@ -2,7 +2,7 @@
# Cookbook:: php # Cookbook:: php
# Attributes:: default # Attributes:: default
# #
# Copyright:: 2011-2016, Chef Software, Inc. # Copyright:: 2011-2017, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -25,10 +25,10 @@ default['php']['bin'] = 'php'
default['php']['pear'] = 'pear' default['php']['pear'] = 'pear'
default['php']['pecl'] = 'pecl' default['php']['pecl'] = 'pecl'
default['php']['version'] = '5.6.13' default['php']['version'] = '5.6.30'
default['php']['url'] = 'http://us1.php.net/get' default['php']['url'] = 'http://us1.php.net/get'
default['php']['checksum'] = '92acc6c067f5e015a6881b4119eafec10eca11722e810f2c2083f72e17119bcf' default['php']['checksum'] = '8bc7d93e4c840df11e3d9855dcad15c1b7134e8acf0cf3b90b932baea2d0bde2'
default['php']['prefix_dir'] = '/usr/local' default['php']['prefix_dir'] = '/usr/local'
default['php']['enable_mod'] = '/usr/sbin/php5enmod' default['php']['enable_mod'] = '/usr/sbin/php5enmod'
default['php']['disable_mod'] = '/usr/sbin/php5dismod' default['php']['disable_mod'] = '/usr/sbin/php5dismod'
@ -46,7 +46,7 @@ default['php']['pgsql']['package'] = 'php5-pgsql'
default['php']['sqlite']['package'] = 'php5-sqlite3' default['php']['sqlite']['package'] = 'php5-sqlite3'
case node['platform_family'] case node['platform_family']
when 'rhel', 'fedora' when 'rhel', 'fedora', 'amazon'
lib_dir = node['kernel']['machine'] =~ /x86_64/ ? 'lib64' : 'lib' lib_dir = node['kernel']['machine'] =~ /x86_64/ ? 'lib64' : 'lib'
default['php']['conf_dir'] = '/etc' default['php']['conf_dir'] = '/etc'
default['php']['ext_conf_dir'] = '/etc/php.d' default['php']['ext_conf_dir'] = '/etc/php.d'
@ -54,28 +54,25 @@ when 'rhel', 'fedora'
default['php']['fpm_group'] = 'nobody' default['php']['fpm_group'] = 'nobody'
default['php']['fpm_listen_user'] = 'nobody' default['php']['fpm_listen_user'] = 'nobody'
default['php']['fpm_listen_group'] = 'nobody' default['php']['fpm_listen_group'] = 'nobody'
default['php']['ext_dir'] = "/usr/#{lib_dir}/php/modules" default['php']['ext_dir'] = "/usr/#{lib_dir}/php/modules"
default['php']['src_deps'] = %w(bzip2-devel libc-client-devel curl-devel freetype-devel gmp-devel libjpeg-devel krb5-devel libmcrypt-devel libpng-devel openssl-devel t1lib-devel mhash-devel) if node['platform'] == 'amazon' # amazon names their packages with versions
if node['platform_version'].to_f < 6 default['php']['src_deps'] = %w(bzip2-devel libc-client-devel curl-devel freetype-devel gmp-devel libjpeg-devel krb5-devel libmcrypt-devel libpng-devel openssl-devel t1lib-devel)
default['php']['packages'] = %w(php53 php53-devel php53-cli php-pear) default['php']['packages'] = %w(php56 php56-devel php-pear)
default['php']['mysql']['package'] = 'php53-mysql' default['php']['fpm_package'] = 'php56-fpm'
else # set fpm attributes as we're on a modern PHP release else # redhat does not name their packages with version on RHEL 6+
default['php']['packages'] = if node['platform'] == 'amazon' # amazon names their packages with versions default['php']['src_deps'] = %w(bzip2-devel libc-client-devel curl-devel freetype-devel gmp-devel libjpeg-devel krb5-devel libmcrypt-devel libpng-devel openssl-devel t1lib-devel mhash-devel)
%w(php56 php56-devel php-pear) default['php']['packages'] = %w(php php-devel php-cli php-pear)
else # redhat does not name their packages with version on RHEL 6+
%w(php php-devel php-cli php-pear)
end
default['php']['mysql']['package'] = 'php-mysql'
default['php']['fpm_package'] = 'php-fpm' default['php']['fpm_package'] = 'php-fpm'
default['php']['fpm_pooldir'] = '/etc/php-fpm.d' end
default['php']['fpm_default_conf'] = '/etc/php-fpm.d/www.conf' default['php']['mysql']['package'] = 'php-mysql'
default['php']['fpm_service'] = 'php-fpm' default['php']['fpm_pooldir'] = '/etc/php-fpm.d'
if node['php']['install_method'] == 'package' default['php']['fpm_default_conf'] = '/etc/php-fpm.d/www.conf'
default['php']['fpm_user'] = 'apache' default['php']['fpm_service'] = 'php-fpm'
default['php']['fpm_group'] = 'apache' if node['php']['install_method'] == 'package'
default['php']['fpm_listen_user'] = 'apache' default['php']['fpm_user'] = 'apache'
default['php']['fpm_listen_group'] = 'apache' default['php']['fpm_group'] = 'apache'
end default['php']['fpm_listen_user'] = 'apache'
default['php']['fpm_listen_group'] = 'apache'
end end
when 'debian' when 'debian'
default['php']['conf_dir'] = '/etc/php5/cli' default['php']['conf_dir'] = '/etc/php5/cli'
@ -120,8 +117,7 @@ when 'debian'
default['php']['ext_conf_dir'] = '/etc/php5/mods-available' default['php']['ext_conf_dir'] = '/etc/php5/mods-available'
end end
when 'debian' when 'debian'
case node['platform_version'].to_i if node['platform_version'].to_i == 8
when 8
default['php']['ext_conf_dir'] = '/etc/php5/mods-available' default['php']['ext_conf_dir'] = '/etc/php5/mods-available'
end end
end end
@ -136,25 +132,6 @@ when 'suse'
default['php']['packages'] = %w(apache2-mod_php5 php5-pear) default['php']['packages'] = %w(apache2-mod_php5 php5-pear)
default['php']['mysql']['package'] = 'php5-mysql' default['php']['mysql']['package'] = 'php5-mysql'
lib_dir = node['kernel']['machine'] =~ /x86_64/ ? 'lib64' : 'lib' lib_dir = node['kernel']['machine'] =~ /x86_64/ ? 'lib64' : 'lib'
when 'windows'
default['php']['windows']['msi_name'] = 'PHP 5.6.30'
default['php']['windows']['msi_source'] = 'http://windows.php.net/downloads/releases/php-5.6.30-nts-Win32-VC11-x86.msi'
default['php']['bin'] = 'php.exe'
default['php']['conf_dir'] = 'C:\Program Files (x86)\PHP'
default['php']['ext_conf_dir'] = node['php']['conf_dir']
# These extensions are installed by default by the GUI MSI
default['php']['packages'] = %w(cgi ScriptExecutable PEAR
iis4FastCGI ext_php_bz2 ext_php_curl
ext_php_exif ext_php_gd2 ext_php_gettext
ext_php_gmp ext_php_imap ext_php_mbstring
ext_php_mysql ext_php_mysqli ext_php_openssl
ext_php_pdo_mysql ext_php_pdo_odbc ext_php_pdo_sqlite
ext_php_pgsql ext_php_soap ext_php_sockets
ext_php_sqlite3 ext_php_tidy ext_php_xmlrpc
)
default['php']['package_options'] = '' # Use this to customise your yum or apt command
default['php']['pear'] = 'pear.bat'
default['php']['pecl'] = 'pecl.bat'
when 'freebsd' when 'freebsd'
default['php']['conf_dir'] = '/usr/local/etc' default['php']['conf_dir'] = '/usr/local/etc'
default['php']['ext_conf_dir'] = '/usr/local/etc/php' default['php']['ext_conf_dir'] = '/usr/local/etc/php'

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
#
# Author:: Joshua Timberman (<joshua@chef.io>)
# Cookbook:: php
# Libraries:: helpers
#
# Copyright:: 2013-2016, 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
#
# 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.
#
def el5_range
(0..99).to_a.map { |i| "5.#{i}" }
end

File diff suppressed because one or more lines are too long

View File

@ -1,89 +0,0 @@
#
# Author:: Chris Marchesi <cmarchesi@paybyphone.com>
# Cookbook:: php
# Provider:: fpm_pool
#
# Copyright:: 2015-2016, Chef Software, Inc <legal@chef.io>
#
# 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
#
# 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.
#
use_inline_resources
def whyrun_supported?
true
end
def install_fpm_package
# Install the FPM pacakge for this platform, if it's available
# Fail the run if it's an unsupported OS (FPM pacakge name not populated)
# also, this is skipped for source
return if node['php']['install_method'] == 'source'
raise 'PHP-FPM package not found (you probably have an unsupported distro)' if node['php']['fpm_package'].nil?
file node['php']['fpm_default_conf'] do
action :nothing
end
package node['php']['fpm_package'] do
action :install
notifies :delete, "file[#{node['php']['fpm_default_conf']}]", :immediately
end
end
def register_fpm_service
service node['php']['fpm_service'] do
action :enable
end
end
action :install do
# Ensure the FPM pacakge is installed, and the service is registered
install_fpm_package
register_fpm_service
# I wanted to have this as a function in itself, but doing this seems to
# break testing suites?
t = template "#{node['php']['fpm_pooldir']}/#{new_resource.pool_name}.conf" do
source 'fpm-pool.conf.erb'
action :create
cookbook 'php'
variables(
fpm_pool_name: new_resource.pool_name,
fpm_pool_user: new_resource.user,
fpm_pool_group: new_resource.group,
fpm_pool_listen: new_resource.listen,
fpm_pool_listen_user: new_resource.listen_user,
fpm_pool_listen_group: new_resource.listen_group,
fpm_pool_manager: new_resource.process_manager,
fpm_pool_max_children: new_resource.max_children,
fpm_pool_start_servers: new_resource.start_servers,
fpm_pool_min_spare_servers: new_resource.min_spare_servers,
fpm_pool_max_spare_servers: new_resource.max_spare_servers,
fpm_pool_chdir: new_resource.chdir,
fpm_pool_additional_config: new_resource.additional_config
)
notifies :restart, "service[#{node['php']['fpm_service']}]"
end
new_resource.updated_by_last_action(t.updated_by_last_action?)
end
action :uninstall do
# Ensure the FPM pacakge is installed, and the service is registered
register_fpm_service
# Delete the FPM pool.
f = file "#{node['php']['fpm_pooldir']}/#{new_resource.pool_name}.conf" do
action :delete
end
new_resource.updated_by_last_action(f.updated_by_last_action?)
end

View File

@ -3,7 +3,7 @@
# Cookbook:: php # Cookbook:: php
# Provider:: pear_package # Provider:: pear_package
# #
# Copyright:: 2011-2016, Chef Software, Inc <legal@chef.io> # Copyright:: 2011-2017, Chef Software, Inc <legal@chef.io>
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -102,7 +102,7 @@ end
# so refactoring into core Chef should be easy # so refactoring into core Chef should be easy
def load_current_resource def load_current_resource
@current_resource = Chef::Resource::PhpPear.new(@new_resource.name) @current_resource = new_resource.class.new(new_resource.name)
@current_resource.package_name(@new_resource.package_name) @current_resource.package_name(@new_resource.package_name)
@bin = node['php']['pear'] @bin = node['php']['pear']
if pecl? if pecl?
@ -177,13 +177,13 @@ end
def enable_package(name) def enable_package(name)
execute "#{node['php']['enable_mod']} #{name}" do execute "#{node['php']['enable_mod']} #{name}" do
only_if { platform?('ubuntu') && node['platform_version'].to_f >= 12.04 && ::File.exist?(node['php']['enable_mod']) } only_if { platform?('ubuntu') && ::File.exist?(node['php']['enable_mod']) }
end end
end end
def disable_package(name) def disable_package(name)
execute "#{node['php']['disable_mod']} #{name}" do execute "#{node['php']['disable_mod']} #{name}" do
only_if { platform?('ubuntu') && node['platform_version'].to_f >= 12.04 && ::File.exist?(node['php']['disable_mod']) } only_if { platform?('ubuntu') && ::File.exist?(node['php']['disable_mod']) }
end end
end end

View File

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

View File

@ -3,7 +3,7 @@
# Cookbook:: php # Cookbook:: php
# Recipe:: ini # Recipe:: ini
# #
# Copyright:: 2011-2016, Chef Software, Inc. # Copyright:: 2011-2017, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -21,10 +21,9 @@
template "#{node['php']['conf_dir']}/php.ini" do template "#{node['php']['conf_dir']}/php.ini" do
source node['php']['ini']['template'] source node['php']['ini']['template']
cookbook node['php']['ini']['cookbook'] cookbook node['php']['ini']['cookbook']
unless platform?('windows') owner 'root'
owner 'root' group node['root_group']
group node['root_group'] mode '0644'
mode '0644' manage_symlink_source true
end
variables(directives: node['php']['directives']) variables(directives: node['php']['directives'])
end end

View File

@ -4,7 +4,7 @@
# Cookbook:: php # Cookbook:: php
# Recipe:: module_apc # Recipe:: module_apc
# #
# Copyright:: 2009-2016, Chef Software, Inc. # Copyright:: 2009-2017, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -20,7 +20,7 @@
# #
case node['platform_family'] case node['platform_family']
when 'rhel', 'fedora' when 'rhel', 'fedora', 'amazon'
package %w(httpd-devel pcre pcre-devel) package %w(httpd-devel pcre pcre-devel)
php_pear 'APC' do php_pear 'APC' do

View File

@ -4,7 +4,7 @@
# Cookbook:: php # Cookbook:: php
# Recipe:: module_apc # Recipe:: module_apc
# #
# Copyright:: 2009-2016, Chef Software, Inc. # Copyright:: 2009-2017, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -20,7 +20,7 @@
# #
case node['platform_family'] case node['platform_family']
when 'rhel', 'fedora' when 'rhel', 'fedora', 'amazon'
package %w(httpd-devel pcre pcre-devel) package %w(httpd-devel pcre pcre-devel)
php_pear 'APCu' do php_pear 'APCu' do

View File

@ -4,7 +4,7 @@
# Cookbook:: php # Cookbook:: php
# Recipe:: module_curl # Recipe:: module_curl
# #
# Copyright:: 2009-2016, Chef Software, Inc. # Copyright:: 2009-2017, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.

View File

@ -4,7 +4,7 @@
# Cookbook:: php # Cookbook:: php
# Recipe:: module_fpdf # Recipe:: module_fpdf
# #
# Copyright:: 2009-2016, Chef Software, Inc. # Copyright:: 2009-2017, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -20,7 +20,7 @@
# #
case node['platform_family'] case node['platform_family']
when 'rhel', 'fedora' when 'rhel', 'fedora', 'amazon'
pearhub_chan = php_pear_channel 'pearhub.org' do pearhub_chan = php_pear_channel 'pearhub.org' do
action :discover action :discover
end end

View File

@ -4,7 +4,7 @@
# Cookbook:: php # Cookbook:: php
# Recipe:: module_gd # Recipe:: module_gd
# #
# Copyright:: 2009-2016, Chef Software, Inc. # Copyright:: 2009-2017, Chef Software, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -21,7 +21,6 @@
pkg = value_for_platform( pkg = value_for_platform(
%w(centos redhat scientific fedora amazon oracle) => { %w(centos redhat scientific fedora amazon oracle) => {
el5_range => 'php53-gd',
'default' => 'php-gd', 'default' => 'php-gd',
}, },
'freebsd' => { 'freebsd' => {

Some files were not shown because too many files have changed in this diff Show More