Update more cookbooks

This commit is contained in:
greg committed 2017-06-16 11:25:49 +02:00
1 parent 7da2c5a738
commit f5858319a7
129 files changed
+1095 -101571

No files matched your search

+26 -24
View File
@@ -9,32 +9,34 @@ Batali.define do
cookbook 'wordpress',
git: 'https://github.com/67P/wordpress-cookbook.git',
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',
git: 'https://github.com/phlipper/chef-redis.git',
ref: 'v0.5.6'
cookbook 'firewall', '~> 2.6.1'
cookbook 'chef_nginx', '~> 6.0.2'
cookbook 'build-essential'
cookbook 'mysql'
cookbook 'postgresql', '~> 6.1'
cookbook 'postfix', '~> 5.0.2'
cookbook 'php-fpm', '~> 0.7.9'
cookbook 'php', '~> 4.2.0'
cookbook 'poise-ruby-build', '~> 1.1.0'
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 'mysql2_chef_gem'
cookbook 'chef_client_updater', '~> 1.0.2'
cookbook 'timezone-ii'
cookbook 'nodejs', '~> 3.0.0'
cookbook 'ark', '~> 3.0.0'
cookbook 'logrotate', '~> 2.1.0'
cookbook 'openssl', '~> 7.0.1'
cookbook 'ntp'
cookbook 'mysql2_chef_gem', '~> 2.0.1'
cookbook 'chef_client_updater', '~> 1.1.1'
cookbook 'timezone-ii', '~> 0.2.0'
cookbook 'nodejs', '~> 3.0.0'
cookbook 'ark', '~> 3.1.0'
cookbook 'logrotate', '~> 2.2.0'
cookbook 'openssl', '~> 7.1.0'
cookbook 'ntp', '~> 3.4.0'
end
+89 -100
View File
@@ -71,21 +71,13 @@
[
"yum-epel",
">= 0.0.0"
],
[
"iis",
">= 0.0.0"
],
[
"windows",
">= 0.0.0"
]
],
"version": "3.0.0",
"version": "4.2.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/php/versions/3.0.0/download",
"version": "3.0.0"
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/php/versions/4.2.0/download",
"version": "4.2.0"
}
},
{
@@ -100,11 +92,11 @@
">= 1.1"
]
],
"version": "8.0.1",
"version": "8.0.3",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/build-essential/versions/8.0.1/download",
"version": "8.0.1"
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/build-essential/versions/8.0.3/download",
"version": "8.0.3"
}
},
{
@@ -200,11 +192,11 @@
"dependencies": [
],
"version": "8.3.0",
"version": "8.4.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/mysql/versions/8.3.0/download",
"version": "8.3.0"
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/mysql/versions/8.4.0/download",
"version": "8.4.0"
}
},
{
@@ -234,21 +226,6 @@
"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",
"dependencies": [
@@ -299,18 +276,6 @@
"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",
"dependencies": [
@@ -335,11 +300,11 @@
">= 0.0.0"
]
],
"version": "6.0.2",
"version": "6.1.1",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/chef_nginx/versions/6.0.2/download",
"version": "6.0.2"
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/chef_nginx/versions/6.1.1/download",
"version": "6.1.1"
}
},
{
@@ -436,11 +401,11 @@
">= 3.0"
]
],
"version": "0.7.8",
"version": "0.7.9",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/php-fpm/versions/0.7.8/download",
"version": "0.7.8"
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/php-fpm/versions/0.7.9/download",
"version": "0.7.9"
}
},
{
@@ -503,6 +468,21 @@
"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",
"dependencies": [
@@ -527,16 +507,32 @@
"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",
"dependencies": [
],
"version": "5.0.1",
"version": "5.0.2",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/postfix/versions/5.0.1/download",
"version": "5.0.1"
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/postfix/versions/5.0.2/download",
"version": "5.0.2"
}
},
{
@@ -862,11 +858,11 @@
">= 0.0.0"
]
],
"version": "0.4.0",
"version": "0.4.2",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/hostname/versions/0.4.0/download",
"version": "0.4.0"
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/hostname/versions/0.4.2/download",
"version": "0.4.2"
}
},
{
@@ -881,22 +877,6 @@
"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",
"dependencies": [
@@ -905,11 +885,11 @@
">= 0.0.0"
]
],
"version": "2.6.1",
"version": "2.6.2",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/firewall/versions/2.6.1/download",
"version": "2.6.1"
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/firewall/versions/2.6.2/download",
"version": "2.6.2"
}
},
{
@@ -920,11 +900,11 @@
">= 12.16.3"
]
],
"version": "1.0.2",
"version": "1.1.1",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/chef_client_updater/versions/1.0.2/download",
"version": "1.0.2"
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/chef_client_updater/versions/1.1.1/download",
"version": "1.1.1"
}
},
{
@@ -970,6 +950,18 @@
"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",
"dependencies": [
@@ -986,38 +978,35 @@
">= 0.0.0"
]
],
"version": "3.0.0",
"version": "3.1.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/ark/versions/3.0.0/download",
"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"
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/ark/versions/3.1.0/download",
"version": "3.1.0"
}
},
{
"name": "logrotate",
"dependencies": [
[
"compat_resource",
">= 0.0.0"
]
],
"version": "2.1.0",
"version": "2.2.0",
"source": {
"type": "Batali::Source::Site",
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/logrotate/versions/2.1.0/download",
"version": "2.1.0"
"url": "https://supermarket.chef.io:443/api/v1/cookbooks/logrotate/versions/2.2.0/download",
"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"
}
},
{
+6
View File
@@ -2,7 +2,13 @@
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)
- Rewrite of resource to custom resources.
- Remove EOL platforms from testing.
- Update zlib URL
+1 -1
View File
@@ -44,7 +44,7 @@ Should work on common Unix/Linux systems with typical userland utilities like ta
### Chef
- Chef 12.5+
- Chef 12.7+
### Cookbooks
+2 -2
View File
@@ -30,10 +30,10 @@ default['ark']['sevenzip_binary'] = nil
pkgs = %w(libtool autoconf) unless platform_family?('mac_os_x')
pkgs += %w(make) unless platform_family?('mac_os_x', 'freebsd')
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(gmake) if platform?('freebsd')
if platform_family?('rhel', 'suse')
if platform_family?('rhel', 'suse', 'amazon')
if node['platform_version'].to_i >= 7
pkgs += %w(xz bzip2 tar)
elsif node['platform_version'].to_i < 7
+1 -1
View File
@@ -1 +1 @@
{"name":"ark","version":"3.0.0","description":"Provides a custom resource for installing runtime artifacts in a predictable fashion","long_description":"# ark cookbook\n\n[![Build Status](https://travis-ci.org/chef-cookbooks/ark.svg?branch=master)](https://travis-ci.org/chef-cookbooks/ark) [![Cookbook Version](https://img.shields.io/cookbook/v/ark.svg)](https://supermarket.chef.io/cookbooks/ark)\n\n## Overview\n\nThis cookbook provides `ark`, a resource for managing software archives. It manages the fetch-unpack-configure-build-install process common to installing software from source, or from binary distributions that are not fully fledged OS packages.\n\nThis cookbook started its life as a modified version of Infochimp's install_from cookbook. It has since been heavily refactored and extended to meet different use cases.\n\nGiven a simple project archive available at a url:\n\n```ruby\nark 'pig' do\n url 'http://apache.org/pig/pig-0.8.0.tar.gz'\nend\n```\n\nThe `ark` resource will:\n\n- fetch it to to `/var/cache/chef/`\n- unpack it to the default path (`/usr/local/pig-0.8.0`)\n- create a symlink for `:home_dir` (`/usr/local/pig`) pointing to path\n- add specified binary commands to the environment `PATH` variable\n\nBy default, the ark will not run again if the `:path` is not empty. Ark provides many actions to accommodate different use cases, such as `:dump`, `:cherry_pick`, `:put`, and `:install_with_make`.\n\nAt this time ark only handles files available from URLs using the [remote_file](http://docs.chef.io/resource_remote_file.html) provider. It does handle local files using the `file://` protocol.\n\n## Requirements\n\n### Platforms\n\n- Debian/Ubuntu\n- RHEL/CentOS/Scientific/Oracle\n- Fedora\n- FreeBSD\n- SmartOS\n- Mac OS X\n- openSUSE / SUSE Linux Enterprises\n- Windows\n\nShould work on common Unix/Linux systems with typical userland utilities like tar, gzip, etc. May require the installation of build tools for compiling from source, but that installation is outside the scope of this cookbook.\n\n### Chef\n\n- Chef 12.5+\n\n### Cookbooks\n\n- build-essential\n- seven_zip\n- windows\n\n## Attributes\n\nCustomize the attributes to suit site specific conventions and defaults.\n\n- `node['ark']['apache_mirror']` - if the URL is an apache mirror, use the attribute as the default. default: `http://apache.mirrors.tds.net`\n- `node['ark']['prefix_root']` - default base location if the `prefix_root` is not passed into the resource. default: `/usr/local`\n- `node['ark']['prefix_bin']` - default binary location if the `prefix_bin` is not passed into the resource. default: `/usr/local/bin`\n- `node['ark']['prefix_home']` - default home location if the `prefix_home` is not passed into the resource. default: `/usr/local`\n- `node['ark']['package_dependencies']` - prerequisite system packages that need to be installed to support ark. default: varies based on platform\n- `node['ark']['tar']` - allows overriding the default path to the tar binary, which varies based on platform\n- `node['ark']['sevenzip_binary']` - allows overriding the default path to the 7zip binary, which is determined based on registry key value\n\n## Resources\n\n- `ark` - does the extract/build/configure \n\n### Actions\n\n- `:install`: extracts the file and creates a 'friendly' symbolic link to the extracted directory path\n- `:configure`: configure ahead of the install action\n- `:install_with_make`: extracts the archive to a path, runs `configure`, `make`, and `make install`.\n- `:dump`: strips all directories from the archive and dumps the contained files into a specified path\n- `:cherry_pick`: extract a specified file from an archive and places in specified path\n- `:put`: extract the archive to a specified path, does not create any symbolic links\n- `:remove`: removes the extracted directory and related symlink #TODO\n- `:setup_py`: runs the command \"python setup.py\" in the extracted directory\n- `:setup_py_build`: runs the command \"python setup.py build\" in the extracted directory\n- `:setup_py_install`: runs the command \"python setup.py install\" in the extracted directory\n\n### :cherry_pick\n\nExtract a specified file from an archive and places in specified path.\n\n#### Relevant Attribute Parameters for :cherry_pick\n\n- `path`: directory to place file in.\n- `creates`: specific file to cherry-pick.\n\n### :dump\n\nStrips all directories from the archive and dumps the contained files into a specified path.\n\nNOTE: This currently only works for zip archives\n\n#### Attribute Parameters for :dump\n\n- `path`: path to dump files to.\n- `mode`: file mode for `app_home`, as an integer.\n\n - Example: `0775`\n\n- `creates`: if you are appending files to a given directory, ark needs a condition to test whether the file has already been extracted. You can specify with creates, a file whose existence indicates the ark has previously been extracted and does not need to be extracted again.\n\n### :put\n\nExtract the archive to aLine truncated
{"name":"ark","version":"3.1.0","description":"Provides a custom resource for installing runtime artifacts in a predictable fashion","long_description":"# ark cookbook\n\n[![Build Status](https://travis-ci.org/chef-cookbooks/ark.svg?branch=master)](https://travis-ci.org/chef-cookbooks/ark) [![Cookbook Version](https://img.shields.io/cookbook/v/ark.svg)](https://supermarket.chef.io/cookbooks/ark)\n\n## Overview\n\nThis cookbook provides `ark`, a resource for managing software archives. It manages the fetch-unpack-configure-build-install process common to installing software from source, or from binary distributions that are not fully fledged OS packages.\n\nThis cookbook started its life as a modified version of Infochimp's install_from cookbook. It has since been heavily refactored and extended to meet different use cases.\n\nGiven a simple project archive available at a url:\n\n```ruby\nark 'pig' do\n url 'http://apache.org/pig/pig-0.8.0.tar.gz'\nend\n```\n\nThe `ark` resource will:\n\n- fetch it to to `/var/cache/chef/`\n- unpack it to the default path (`/usr/local/pig-0.8.0`)\n- create a symlink for `:home_dir` (`/usr/local/pig`) pointing to path\n- add specified binary commands to the environment `PATH` variable\n\nBy default, the ark will not run again if the `:path` is not empty. Ark provides many actions to accommodate different use cases, such as `:dump`, `:cherry_pick`, `:put`, and `:install_with_make`.\n\nAt this time ark only handles files available from URLs using the [remote_file](http://docs.chef.io/resource_remote_file.html) provider. It does handle local files using the `file://` protocol.\n\n## Requirements\n\n### Platforms\n\n- Debian/Ubuntu\n- RHEL/CentOS/Scientific/Oracle\n- Fedora\n- FreeBSD\n- SmartOS\n- Mac OS X\n- openSUSE / SUSE Linux Enterprises\n- Windows\n\nShould work on common Unix/Linux systems with typical userland utilities like tar, gzip, etc. May require the installation of build tools for compiling from source, but that installation is outside the scope of this cookbook.\n\n### Chef\n\n- Chef 12.7+\n\n### Cookbooks\n\n- build-essential\n- seven_zip\n- windows\n\n## Attributes\n\nCustomize the attributes to suit site specific conventions and defaults.\n\n- `node['ark']['apache_mirror']` - if the URL is an apache mirror, use the attribute as the default. default: `http://apache.mirrors.tds.net`\n- `node['ark']['prefix_root']` - default base location if the `prefix_root` is not passed into the resource. default: `/usr/local`\n- `node['ark']['prefix_bin']` - default binary location if the `prefix_bin` is not passed into the resource. default: `/usr/local/bin`\n- `node['ark']['prefix_home']` - default home location if the `prefix_home` is not passed into the resource. default: `/usr/local`\n- `node['ark']['package_dependencies']` - prerequisite system packages that need to be installed to support ark. default: varies based on platform\n- `node['ark']['tar']` - allows overriding the default path to the tar binary, which varies based on platform\n- `node['ark']['sevenzip_binary']` - allows overriding the default path to the 7zip binary, which is determined based on registry key value\n\n## Resources\n\n- `ark` - does the extract/build/configure \n\n### Actions\n\n- `:install`: extracts the file and creates a 'friendly' symbolic link to the extracted directory path\n- `:configure`: configure ahead of the install action\n- `:install_with_make`: extracts the archive to a path, runs `configure`, `make`, and `make install`.\n- `:dump`: strips all directories from the archive and dumps the contained files into a specified path\n- `:cherry_pick`: extract a specified file from an archive and places in specified path\n- `:put`: extract the archive to a specified path, does not create any symbolic links\n- `:remove`: removes the extracted directory and related symlink #TODO\n- `:setup_py`: runs the command \"python setup.py\" in the extracted directory\n- `:setup_py_build`: runs the command \"python setup.py build\" in the extracted directory\n- `:setup_py_install`: runs the command \"python setup.py install\" in the extracted directory\n\n### :cherry_pick\n\nExtract a specified file from an archive and places in specified path.\n\n#### Relevant Attribute Parameters for :cherry_pick\n\n- `path`: directory to place file in.\n- `creates`: specific file to cherry-pick.\n\n### :dump\n\nStrips all directories from the archive and dumps the contained files into a specified path.\n\nNOTE: This currently only works for zip archives\n\n#### Attribute Parameters for :dump\n\n- `path`: path to dump files to.\n- `mode`: file mode for `app_home`, as an integer.\n\n - Example: `0775`\n\n- `creates`: if you are appending files to a given directory, ark needs a condition to test whether the file has already been extracted. You can specify with creates, a file whose existence indicates the ark has previously been extracted and does not need to be extracted again.\n\n### :put\n\nExtract the archive to aLine truncated
+1 -1
View File
@@ -523,6 +523,6 @@ action :configure do
end
end
action_class.class_eval do
action_class do
include ::Ark::ProviderHelpers
end
+9
View File
@@ -2,6 +2,15 @@
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)
- Test with local delivery and not Rake
+1 -1
View File
@@ -1 +1 @@
{"name":"build-essential","version":"8.0.1","description":"Installs C compiler / build tools","long_description":"# build-essential Cookbook\n\n[![Cookbook Version](http://img.shields.io/cookbook/v/build-essential.svg)][cookbook] [![Build Status](https://travis-ci.org/chef-cookbooks/build-essential.svg?branch=master)](https://travis-ci.org/chef-cookbooks/build-essential)\n\nInstalls packages required for compiling C software from source. Use this cookbook if you wish to compile C programs, or install RubyGems with native extensions. Contains a resource, 'build_essential', as as well as a default recipe that simply calls that same resource.\n\n## Requirements\n\n### Platforms\n\n- Debian/Ubuntu\n- RHEL/CentOS/Scientific/Amazon/Oracle\n- openSUSE / SUSE Enterprise Linux\n- SmartOS\n- Fedora\n- Mac OS X 10.9+\n- FreeBSD\n\n### Chef\n\n- Chef 12.5+\n\n### Cookbooks\n\n- seven_zip\n- mingw\n\n**Note for Debian platform family:** On Debian platform-family systems, it is recommended that `apt-get update` be run, to ensure that the package cache is updated. It's not in the scope of this cookbook to do that, as it can [create a duplicate resource](https://tickets.chef.io/browse/CHEF-3694). We recommend using the [apt](https://supermarket.chef.io/cookbooks/apt) cookbook to do this.\n\n## Attributes\n\nAttribute | Default | Description\n------------------------------------------ | :---------------------------: | -----------------------------------------------------\n`node['build-essential']['compile_time']` | `false` | Execute resources at compile time\n`node['build-essential']['msys2']['path']` | `#{ENV['SYSTEMDRIVE']\\\\msys2` | Destination for msys2 build tool chain (Windows only)\n\n## Usage\n\n### Recipe Usage\n\nThe recipe simply calls the build_essential resource, but it ideal for adding to roles or node run lists.\n\nInclude the build-essential recipe in your run list:\n\n```sh\nknife node run_list add NODE \"recipe[build-essential::default]\"\n```\n\nor add the build-essential recipe as a dependency and include it from inside another cookbook:\n\n```ruby\ninclude_recipe 'build-essential::default'\n```\n\n### Gems with C extensions\n\nFor RubyGems that include native C extensions you wish to use with Chef, you should do the following.\n\n- Set the `compile_time` attribute to true in your wrapper cookbook or role:\n\n ```ruby\n # Wrapper attribute\n default['build-essential']['compile_time'] = true\n ```\n\n ```ruby\n # Role\n default_attributes(\n 'build-essential' => {\n 'compile_time' => true\n }\n )\n ```\n\n- Ensure that the C libraries, which include files and other assorted \"dev\"\n\n type packages, are installed in the compile phase after the build-essential\n\n recipe is executed. For example:\n\n ```ruby\n include_recipe 'build-essential::default'\n\n package('mypackage-devel') { action :nothing }.run_action(:install)\n ```\n\n- Use the `chef_gem` resource in your recipe to install the gem with the native\n\n extension:\n\n ```ruby\n chef_gem 'gem-with-native-extension'\n ```\n\n### Resource Usage\n\nThe cookbook includes a resource 'build_essential' that can be included in your cookbook to install the necessary build-essential packages\n\nSimple package installation during the client run:\n\n```ruby\nbuild_essential 'some name you choose'\n```\n\nPackage installation during the compile phase:\n\n```ruby\nbuild_essential 'some name you choose' do\n compile_time false\nend\n```\n\n## License & Authors\n\n**Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io))\n\n**Copyright:** 2009-2016, Chef Software, Inc.\n\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```\n\n[cookbook]: https://supermarket.chef.io/cookbooks/build-essential\n[travis]: http://travis-ci.org/chef-cookbooks/build-essential\n","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","fedora":">= 0.0.0","freebsd":">= 0.0.0","mac_os_x":">= 10.9.0","mac_os_x_server":">= 10.9.0","opensuse":">= 0.0.0","opensuseleap":">= 0.0.0","oracle":">= 0.0.0","redhat":">= 0.0.0","scientific":">= 0.0.0","smartos":">= 0.0.0","solaris":">= 0.0.0","suse":">= 0.0.0","ubuntu":">= 0.0.0","windows":">= 0.0.0","zlinux":">= 0.0.0"},"dependencies":{"seven_zip":">= 0.0.0","mingw":">= 1.1"},"recommendations":{},"suggestLine truncated
{"name":"build-essential","version":"8.0.3","description":"Installs C compiler / build tools","long_description":"# build-essential Cookbook\n\n[![Cookbook Version](http://img.shields.io/cookbook/v/build-essential.svg)][cookbook] [![Build Status](https://travis-ci.org/chef-cookbooks/build-essential.svg?branch=master)](https://travis-ci.org/chef-cookbooks/build-essential)\n\nInstalls packages required for compiling C software from source. Use this cookbook if you wish to compile C programs, or install RubyGems with native extensions. Contains a resource, 'build_essential', as as well as a default recipe that simply calls that same resource.\n\n## Requirements\n\n### Platforms\n\n- Debian/Ubuntu\n- RHEL/CentOS/Scientific/Amazon/Oracle\n- openSUSE / SUSE Enterprise Linux\n- SmartOS\n- Fedora\n- Mac OS X 10.9+\n- FreeBSD\n\n### Chef\n\n- Chef 12.5+\n\n### Cookbooks\n\n- seven_zip\n- mingw\n\n**Note for Debian platform family:** On Debian platform-family systems, it is recommended that `apt-get update` be run, to ensure that the package cache is updated. It's not in the scope of this cookbook to do that, as it can [create a duplicate resource](https://tickets.chef.io/browse/CHEF-3694). We recommend using the [apt](https://supermarket.chef.io/cookbooks/apt) cookbook to do this.\n\n## Attributes\n\nAttribute | Default | Description\n------------------------------------------ | :---------------------------: | -----------------------------------------------------\n`node['build-essential']['compile_time']` | `false` | Execute resources at compile time\n`node['build-essential']['msys2']['path']` | `#{ENV['SYSTEMDRIVE']\\\\msys2` | Destination for msys2 build tool chain (Windows only)\n\n## Usage\n\n### Recipe Usage\n\nThe recipe simply calls the build_essential resource, but it ideal for adding to roles or node run lists.\n\nInclude the build-essential recipe in your run list:\n\n```sh\nknife node run_list add NODE \"recipe[build-essential::default]\"\n```\n\nor add the build-essential recipe as a dependency and include it from inside another cookbook:\n\n```ruby\ninclude_recipe 'build-essential::default'\n```\n\n### Gems with C extensions\n\nFor RubyGems that include native C extensions you wish to use with Chef, you should do the following.\n\n- Set the `compile_time` attribute to true in your wrapper cookbook or role:\n\n ```ruby\n # Wrapper attribute\n default['build-essential']['compile_time'] = true\n ```\n\n ```ruby\n # Role\n default_attributes(\n 'build-essential' => {\n 'compile_time' => true\n }\n )\n ```\n\n- Ensure that the C libraries, which include files and other assorted \"dev\"\n\n type packages, are installed in the compile phase after the build-essential\n\n recipe is executed. For example:\n\n ```ruby\n include_recipe 'build-essential::default'\n\n package('mypackage-devel') { action :nothing }.run_action(:install)\n ```\n\n- Use the `chef_gem` resource in your recipe to install the gem with the native\n\n extension:\n\n ```ruby\n chef_gem 'gem-with-native-extension'\n ```\n\n### Resource Usage\n\nThe cookbook includes a resource 'build_essential' that can be included in your cookbook to install the necessary build-essential packages\n\nSimple package installation during the client run:\n\n```ruby\nbuild_essential 'some name you choose'\n```\n\nPackage installation during the compile phase:\n\n```ruby\nbuild_essential 'some name you choose' do\n compile_time false\nend\n```\n\n## License & Authors\n\n**Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io))\n\n**Copyright:** 2009-2016, Chef Software, Inc.\n\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```\n\n[cookbook]: https://supermarket.chef.io/cookbooks/build-essential\n[travis]: http://travis-ci.org/chef-cookbooks/build-essential\n","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","fedora":">= 0.0.0","freebsd":">= 0.0.0","mac_os_x":">= 10.9.0","opensuse":">= 0.0.0","opensuseleap":">= 0.0.0","oracle":">= 0.0.0","redhat":">= 0.0.0","scientific":">= 0.0.0","smartos":">= 0.0.0","solaris2":">= 0.0.0","suse":">= 0.0.0","ubuntu":">= 0.0.0","windows":">= 0.0.0","zlinux":">= 0.0.0"},"dependencies":{"seven_zip":">= 0.0.0","mingw":">= 1.1"},"recommendations":{},"suggestions":{},"conflicting":{},"prLine truncated
@@ -44,7 +44,7 @@ action :install do
end
end
action_class.class_eval do
action_class do
#
# Determine if the XCode Command Line Tools are installed
#
@@ -1 +0,0 @@
~FC016
@@ -2,6 +2,23 @@
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)
- Fix Chef 13 compatibility by using Kernel.exec not exec
+9 -1
View File
@@ -18,10 +18,16 @@ This cookbook updates the chef-client
- 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.
### 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
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`
- `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
- `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
@@ -26,4 +26,10 @@ default['chef_client_updater']['prevent_downgrade'] = true
default['chef_client_updater']['version'] = 'latest'
# 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
+1 -1
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":[]}
@@ -22,4 +22,6 @@ chef_client_updater 'update chef-client' do
version node['chef_client_updater']['version']
prevent_downgrade node['chef_client_updater']['prevent_downgrade']
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
@@ -26,9 +26,11 @@ property :version, [String, Symbol], default: :latest
property :post_install_action, String, default: 'exec'
property :exec_command, String, default: $PROGRAM_NAME.split(' ').first
property :exec_args, Array, default: ARGV
property :download_url_override, String
property :checksum, String
action :update do
if update_necessary? # ~FC023
if update_necessary?
converge_by "Upgraded chef-client #{current_version} to #{desired_version}" do
upgrade_command = Mixlib::ShellOut.new(mixlib_install.install_command)
upgrade_command.run_command
@@ -37,12 +39,14 @@ action :update do
end
end
action_class.class_eval do
action_class do
def load_mixlib_install
gem 'mixlib-install', '~> 3.2', '>= 3.2.1'
require 'mixlib/install'
rescue LoadError
Chef::Log.info('mixlib-install gem not found. Installing now')
chef_gem 'mixlib-install' do
version '>= 3.2.1'
compile_time true if respond_to?(:compile_time)
end
@@ -69,6 +73,9 @@ action_class.class_eval do
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)
end
@@ -80,7 +87,7 @@ action_class.class_eval do
end
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
# 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
cur_version = Mixlib::Versioning.parse(current_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)
end
+15
View File
@@ -2,6 +2,21 @@
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)
- Resolve name conflicts in the resource
+24 -19
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:
- Ubuntu 12.04+
- CentOS 5+
- Ubuntu 14.04+
- CentOS 6+
- Debian 7+
- openSUSE 13.2+
- FreeBSD 9+
- openSUSE
- FreeBSD
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.
### 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
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']['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
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']['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
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']['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
- `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_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
These attributes are used in the `chef_nginx::socketproxy` recipe.
+2 -6
View File
@@ -41,11 +41,7 @@ default['nginx']['repo_source'] = 'nginx'
default['nginx']['install_method'] = 'package'
case node['platform_family']
when 'debian'
default['nginx']['user'] = 'www-data'
when 'rhel'
default['nginx']['user'] = 'nginx'
when 'fedora'
when 'rhel', 'fedora', 'amazon'
default['nginx']['user'] = 'nginx'
when 'freebsd'
default['nginx']['package_name'] = 'www/nginx'
@@ -57,7 +53,7 @@ when 'freebsd'
when 'suse'
default['nginx']['user'] = 'wwwrun'
default['nginx']['group'] = 'www'
else
else # debian probably
default['nginx']['user'] = 'www-data'
end
+21 -14
View File
@@ -19,17 +19,24 @@
# limitations under the License.
#
case node['platform_family']
when 'rhel', 'fedora'
default['nginx']['upstream_repository'] = case node['platform']
when 'centos'
# See http://wiki.nginx.org/Install
"http://nginx.org/packages/centos/#{node['platform_version'].to_i}/$basearch/"
when 'amazon'
'http://nginx.org/packages/rhel/6/$basearch/'
else
"http://nginx.org/packages/rhel/#{node['platform_version'].to_i}/$basearch/"
end
when 'debian'
default['nginx']['upstream_repository'] = "http://nginx.org/packages/#{node['platform']}"
end
default['nginx']['upstream_repository'] =
case node['platform_family']
when 'amazon' # Chef 13+ on amazon linux
'http://nginx.org/packages/rhel/6/$basearch/'
when 'rhel', 'fedora'
case node['platform']
when 'centos'
# See http://wiki.nginx.org/Install
"http://nginx.org/packages/centos/#{node['platform_version'].to_i}/$basearch/"
when 'amazon' # Chef < 13 on Amazon
'http://nginx.org/packages/rhel/6/$basearch/'
else
"http://nginx.org/packages/rhel/#{node['platform_version'].to_i}/$basearch/"
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'
@@ -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
+1 -1
View File
@@ -1 +1 @@
{"name":"chef_nginx","version":"6.0.2","description":"Installs and configures nginx","long_description":"# nginx Cookbook\n\n[![Cookbook](http://img.shields.io/cookbook/v/chef_nginx.svg)](https://supermarket.chef.io/cookbooks/chef_nginx) [![Build Status](https://travis-ci.org/chef-cookbooks/chef_nginx.svg?branch=master)](https://travis-ci.org/chef-cookbooks/chef_nginx)\n\nInstalls nginx from package OR source code and sets up configuration handling similar to Debian's Apache2 scripts.\n\n## nginx vs. chef_nginx\n\nThis cookbook is a fork from the 2.7.x branch of the [community nginx cookbook](https://github.com/miketheman/nginx).\n\nThis fork will be actively supported by Chef Software and we will continue to migrate the cookbook to a more resource driven model, with incremental changes following the SemVer model.\n\n## Requirements\n\n### Cookbooks\n\nThe following cookbooks are direct dependencies because they're used for common \"default\" functionality.\n\n- `build-essential` for source installations\n- `ohai` for setting up the ohai plugin\n- `compat_resource` for setting up the nginx.org repository on Chef 12.1 - 12.13\n- `yum-epel` for setting up the EPEL repository on RHEL platforms\n- `zypper` for setting up the nginx.org repository on Suse platforms\n\n### Platforms\n\nThe following platforms are supported and tested with Test Kitchen:\n\n- Ubuntu 12.04+\n- CentOS 5+\n- Debian 7+\n- openSUSE 13.2+\n- FreeBSD 9+\n\nOther Debian and RHEL family distributions are assumed to work.\n\n### Chef\n\n- Chef 12.1+\n\n## Attributes\n\nNode attributes for this cookbook are logically separated into different files. Some attributes are set only via a specific recipe.\n\n### chef_nginx::auth_request\n\nThese attributes are used in the `chef_nginx::auth_request` recipe.\n\n- `node['nginx']['auth_request']['url']` - The url to the auth_request module tar.gz file\n- `node['nginx']['auth_request']['checksum']` - The checksum of the auth_request module tar.gz file\n\n### chef_nginx::default\n\nGenerally used attributes. Some have platform specific values. See `attributes/default.rb`. \"The Config\" refers to \"nginx.conf\" the main config file.\n\n- `node['nginx']['dir']` - Location for nginx configuration.\n- `node['nginx']['conf_template']` - The `source` template to use when creating the `nginx.conf`.\n- `node['nginx']['conf_cookbook']` - The cookbook where `node['nginx']['conf_template']` resides.\n- `node['nginx']['log_dir']` - Location for nginx logs.\n- `node['nginx']['log_dir_perm']` - Permissions for nginx logs folder.\n- `node['nginx']['user']` - User that nginx will run as.\n- `node['nginx']['group']` - Group for nginx.\n- `node['nginx']['port']` - Port for nginx to listen on.\n- `node['nginx']['binary']` - Path to the nginx binary.\n- `node['nginx']['init_style']` - How to run nginx as a service when using `chef_nginx::source`. Values can be \"upstart\", \"systemd\", or \"init\". This attribute is not used in the `package` recipe because the package manager's init script style for the platform is assumed.\n- `node['nginx']['upstart']['foreground']` - Set this to true if you want upstart to run nginx in the foreground, set to false if you want upstart to detach and track the process via pid.\n- `node['nginx']['upstart']['runlevels']` - String of runlevels in the format '2345' which determines which runlevels nginx will start at when entering and stop at when leaving.\n- `node['nginx']['upstart']['respawn_limit']` - Respawn limit in upstart stanza format, count followed by space followed by interval in seconds.\n- `node['nginx']['keepalive']` - Whether to use `keepalive_timeout`, any value besides \"on\" will leave that option out of the config.\n- `node['nginx']['keepalive_requests']` - used for config value of `keepalive_requests`.\n- `node['nginx']['keepalive_timeout']` - used for config value of `keepalive_timeout`.\n- `node['nginx']['worker_processes']` - used for config value of `worker_processes`.\n- `node['nginx']['worker_connections']` - used for config value of `events { worker_connections }`\n- `node['nginx']['worker_rlimit_nofile']` - used for config value of `worker_rlimit_nofile`. Can replace any \"ulimit -n\" command. The value depend on your usage (cache or not) but must always be superior than worker_connections.\n- `node['nginx']['worker_shutdown_timeout']` - used for config value of `worker_shutdown_timeout`.\n- `node['nginx']['worker_connections']` - used for config value of `events { worker_connections }`\n- `node['nginx']['multi_accept']` - used for config value of `events { multi_accept }`. Try to accept() as many connections as possible. Disable by default.\n- `node['nginx']['event']` - used for config value of `events { use }`. Set the event-model. By default nginx looks for the most suitable method for your OS.\n- `node['nginx']['accept_mutex_delay']` - used for config value of `accept_mutex_delay`\n- `node['nginx']['server_tokens']` - used for config value of `server_tokens`.\n- Line truncated
{"name":"chef_nginx","version":"6.1.1","description":"Installs and configures nginx","long_description":"# nginx Cookbook\n\n[![Cookbook](http://img.shields.io/cookbook/v/chef_nginx.svg)](https://supermarket.chef.io/cookbooks/chef_nginx) [![Build Status](https://travis-ci.org/chef-cookbooks/chef_nginx.svg?branch=master)](https://travis-ci.org/chef-cookbooks/chef_nginx)\n\nInstalls nginx from package OR source code and sets up configuration handling similar to Debian's Apache2 scripts.\n\n## nginx vs. chef_nginx\n\nThis cookbook is a fork from the 2.7.x branch of the [community nginx cookbook](https://github.com/miketheman/nginx).\n\nThis fork will be actively supported by Chef Software and we will continue to migrate the cookbook to a more resource driven model, with incremental changes following the SemVer model.\n\n## Requirements\n\n### Cookbooks\n\nThe following cookbooks are direct dependencies because they're used for common \"default\" functionality.\n\n- `build-essential` for source installations\n- `ohai` for setting up the ohai plugin\n- `compat_resource` for setting up the nginx.org repository on Chef 12.1 - 12.13\n- `yum-epel` for setting up the EPEL repository on RHEL platforms\n- `zypper` for setting up the nginx.org repository on Suse platforms\n\n### Platforms\n\nThe following platforms are supported and tested with Test Kitchen:\n\n- Ubuntu 14.04+\n- CentOS 6+\n- Debian 7+\n- openSUSE\n- FreeBSD\n\nOther Debian and RHEL family distributions are assumed to work.\n\n### Chef\n\n- Chef 12.1+\n\n## Attributes\n\nNode attributes for this cookbook are logically separated into different files. Some attributes are set only via a specific recipe.\n\n### chef_nginx::auth_request\n\nThese attributes are used in the `chef_nginx::auth_request` recipe.\n\n- `node['nginx']['auth_request']['url']` - The url to the auth_request module tar.gz file\n- `node['nginx']['auth_request']['checksum']` - The checksum of the auth_request module tar.gz file\n\n### chef_nginx::default\n\nGenerally used attributes. Some have platform specific values. See `attributes/default.rb`. \"The Config\" refers to \"nginx.conf\" the main config file.\n\n- `node['nginx']['dir']` - Location for nginx configuration.\n- `node['nginx']['conf_template']` - The `source` template to use when creating the `nginx.conf`.\n- `node['nginx']['conf_cookbook']` - The cookbook where `node['nginx']['conf_template']` resides.\n- `node['nginx']['log_dir']` - Location for nginx logs.\n- `node['nginx']['log_dir_perm']` - Permissions for nginx logs folder.\n- `node['nginx']['user']` - User that nginx will run as.\n- `node['nginx']['group']` - Group for nginx.\n- `node['nginx']['port']` - Port for nginx to listen on.\n- `node['nginx']['binary']` - Path to the nginx binary.\n- `node['nginx']['init_style']` - How to run nginx as a service when using `chef_nginx::source`. Values can be \"upstart\", \"systemd\", or \"init\". This attribute is not used in the `package` recipe because the package manager's init script style for the platform is assumed.\n- `node['nginx']['upstart']['foreground']` - Set this to true if you want upstart to run nginx in the foreground, set to false if you want upstart to detach and track the process via pid.\n- `node['nginx']['upstart']['runlevels']` - String of runlevels in the format '2345' which determines which runlevels nginx will start at when entering and stop at when leaving.\n- `node['nginx']['upstart']['respawn_limit']` - Respawn limit in upstart stanza format, count followed by space followed by interval in seconds.\n- `node['nginx']['keepalive']` - Whether to use `keepalive_timeout`, any value besides \"on\" will leave that option out of the config.\n- `node['nginx']['keepalive_requests']` - used for config value of `keepalive_requests`.\n- `node['nginx']['keepalive_timeout']` - used for config value of `keepalive_timeout`.\n- `node['nginx']['worker_processes']` - used for config value of `worker_processes`.\n- `node['nginx']['worker_connections']` - used for config value of `events { worker_connections }`\n- `node['nginx']['worker_rlimit_nofile']` - used for config value of `worker_rlimit_nofile`. Can replace any \"ulimit -n\" command. The value depend on your usage (cache or not) but must always be superior than worker_connections.\n- `node['nginx']['worker_shutdown_timeout']` - used for config value of `worker_shutdown_timeout`.\n- `node['nginx']['worker_connections']` - used for config value of `events { worker_connections }`\n- `node['nginx']['multi_accept']` - used for config value of `events { multi_accept }`. Try to accept() as many connections as possible. Disable by default.\n- `node['nginx']['event']` - used for config value of `events { use }`. Set the event-model. By default nginx looks for the most suitable method for your OS.\n- `node['nginx']['accept_mutex_delay']` - used for config value of `accept_mutex_delay`\n- `node['nginx']['server_tokens']` - used for config value of `server_tokens`.\n- `node['ngLine truncated
+1 -1
View File
@@ -43,7 +43,7 @@ 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|
file "/etc/nginx/conf.d/#{config}" do
action :delete
@@ -22,7 +22,7 @@ remote_file psol_src_filepath do
end
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']
)
+2 -6
View File
@@ -18,16 +18,12 @@
#
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(debian) => node['nginx']['passenger']['packages']['debian']
)
unless packages.empty?
packages.each do |name|
package name
end
end
package packages unless packages.empty?
gem_package 'rake' if node['nginx']['passenger']['install_rake']
+5 -5
View File
@@ -19,12 +19,12 @@
#
case node['platform_family']
when 'rhel'
when 'rhel', 'amazon'
yum_repository 'nginx' do
description 'Nginx.org Repository'
baseurl node['nginx']['upstream_repository']
gpgkey 'http://nginx.org/keys/nginx_signing.key'
gpgkey node['nginx']['repo_signing_key']
action :create
end
@@ -32,8 +32,8 @@ when 'suse'
zypper_repo 'nginx' do
repo_name 'Nginx.org Repository'
uri 'http://nginx.org/packages/sles/12'
key 'http://nginx.org/keys/nginx_signing.key'
uri node['nginx']['upstream_repository']
key node['nginx']['repo_signing_key']
end
when 'debian'
@@ -43,7 +43,7 @@ when 'debian'
distribution node['lsb']['codename']
components %w(nginx)
deb_src true
key 'http://nginx.org/keys/nginx_signing.key'
key node['nginx']['repo_signing_key']
end
else
+2 -2
View File
@@ -21,7 +21,7 @@
# 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']['daemon_disable'] = true
@@ -42,7 +42,7 @@ src_filepath = "#{Chef::Config['file_cache_path']}/nginx-#{node['nginx']['source
# install prereqs
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(debian) => %w(libpcre3 libpcre3-dev libssl-dev tar)
)
@@ -2,6 +2,6 @@
set_real_ip_from <%= address %>;
<% end -%>
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'] %>;
<% end -%>
+6
View File
@@ -2,6 +2,12 @@ firewall Cookbook CHANGELOG
=======================
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)
-------------------
* Add recipe to disable firewall (#164)
@@ -43,7 +43,7 @@ class Chef
rule_files = %w(rules.v4)
rule_files << 'rules.v6' if ipv6_enabled?(new_resource)
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
f = lookup_or_create_rulesfile(svc)
@@ -43,7 +43,7 @@ class Chef
rule_files = %w(rules.v4)
rule_files << 'rules.v6' if ipv6_enabled?(new_resource)
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
f = lookup_or_create_rulesfile(svc)
+1 -1
View File
@@ -1 +1 @@
{"name":"firewall","version":"2.6.1","description":"Provides a set of primitives for managing firewalls and associated rules.","long_description":"firewall Cookbook\n=================\n\n[![Build Status](https://travis-ci.org/chef-cookbooks/firewall.svg?branch=master)](http://travis-ci.org/chef-cookbooks/firewall)\n[![Cookbook Version](https://img.shields.io/cookbook/v/firewall.svg)](https://supermarket.chef.io/cookbooks/firewall)\n\nProvides a set of primitives for managing firewalls and associated rules.\n\nPLEASE NOTE - The resource/providers in this cookbook are under heavy development. An attempt is being made to keep the resource simple/stupid by starting with less sophisticated firewall implementations first and refactor/vet the resource definition with each successive provider.\n\nRequirements\n------------\n**Chef 12.4.x+** is required. We are currently testing against 12.8.1. If you need Chef 11 support, please try pinning back to a version less than 2.0, e.g.:\n```\ndepends 'firewall', '< 2.0'\n```\n\n### Supported firewalls and platforms\n* UFW - Ubuntu, Debian\n* IPTables - Red Hat & CentOS, Ubuntu\n* FirewallD - Red Hat & CentOS >= 7.0 (IPv4 only support, [needs contributions/testing](https://github.com/chef-cookbooks/firewall/issues/86))\n* Windows Advanced Firewall - 2012 R2\n\nTested on:\n* Ubuntu 12.04, 14.04, 16.04 with iptables, ufw\n* Debian 7.8, 8.1 with ufw\n* CentOS 5.11, 6.7 with iptables\n* CentOS 7.1 with firewalld\n* Windows Server 2012r2 with Windows Advanced Firewall\n\nBy default, Ubuntu chooses ufw. To switch to iptables, set this in an attribute file:\n```\ndefault['firewall']['ubuntu_iptables'] = true\n```\n\nBy default, Red Hat & CentOS >= 7.0 chooses firewalld. To switch to iptables, set this in an attribute file:\n```\ndefault['firewall']['redhat7_iptables'] = true\n```\n\n# Considerations that apply to all firewall providers and resources\n\nThis cookbook comes with two resources, firewall and firewall rule. The typical usage scenario is as follows:\n\n- run the `:install` action on the `firewall` resource named 'default', which installs appropriate packages and configures services to start on boot and starts them\n\n- run the `:create` action on every `firewall_rule` resource, which adds to the list of rules that should be configured on the firewall. `firewall_rule` then automatically sends a delayed notification to the `firewall['default']` resource to run the `:restart` action.\n\n- run the delayed notification with action `:restart` on the `firewall` resource. if any rules are different than the last run, the provider will update the current state of the firewall rules to match the expected rules.\n\nThere is a fundamental mismatch between the idea of a chef action and the action that should be taken on a firewall rule. For this reason, the chef action for a firewall_rule may be `:nothing` (the rule should not be present in the firewall) or `:create` (the rule should be present in the firewall), but the action taken on a packet in a firewall (`DROP`, `ACCEPT`, etc) is denoted as a `command` parameter on the `firewall_rule` resource.\n\n# iptables considerations\n\nIf you need to use a table other than `*filter`, the best way to do so is like so:\n```\nnode.default['firewall']['iptables']['defaults'][:ruleset] = {\n '*filter' => 1,\n ':INPUT DROP' => 2,\n ':FORWARD DROP' => 3,\n ':OUTPUT ACCEPT_FILTER' => 4,\n 'COMMIT_FILTER' => 100,\n '*nat' => 101,\n ':PREROUTING DROP' => 102,\n ':POSTROUTING DROP' => 103,\n ':OUTPUT ACCEPT_NAT' => 104,\n 'COMMIT_NAT' => 200\n}\n```\n\nNote -- in order to support multiple hash keys containing the same rule, anything found after the underscore will be stripped for: `:OUTPUT :INPUT :POSTROUTING :PREROUTING COMMIT`. This allows an example like the above to be reduced to just repeated lines of `COMMIT` and `:OUTPUT ACCEPT` while still avoiding duplication of other things.\n\nThen it's trivial to add additional rules to the `*nat` table using the raw parameter:\n```\nfirewall_rule \"postroute\" do\n raw \"-A POSTROUTING -o eth1 -p tcp -d 172.28.128.21 -j SNAT --to-source 172.28.128.6\"\n position 150\nend\n```\n\nNote that any line starting with `COMMIT` will become just `COMMIT`, as hash\nkeys must be unique but we need multiple commit lines.\n\n# Recipes\n\n### default\nThe default recipe creates a firewall resource with action install.\n\n### disable_firewall\nUsed to disable platform specific firewall. Many clouds have their own firewall configured outside of the OS instance such as AWS Security Groups.\n\n# Attributes\n\n* `default['firewall']['allow_ssh'] = false`, set true to open port 22 for SSH when the default recipe runs\n* `default['firewall']['allow_mosh'] = false`, set to true to open UDP ports 60000 - 61000 for [Mosh][0] when the default recipe runs\n* `default['firewall']['allow_winrm'] = false`, set true to open port 5989 for WinRM when the default recipe runs\n* `default['firewall']['allow_loopback'] = falLine truncated
{"name":"firewall","version":"2.6.2","description":"Provides a set of primitives for managing firewalls and associated rules.","long_description":"firewall Cookbook\n=================\n\n[![Build Status](https://travis-ci.org/chef-cookbooks/firewall.svg?branch=master)](http://travis-ci.org/chef-cookbooks/firewall)\n[![Cookbook Version](https://img.shields.io/cookbook/v/firewall.svg)](https://supermarket.chef.io/cookbooks/firewall)\n\nProvides a set of primitives for managing firewalls and associated rules.\n\nPLEASE NOTE - The resource/providers in this cookbook are under heavy development. An attempt is being made to keep the resource simple/stupid by starting with less sophisticated firewall implementations first and refactor/vet the resource definition with each successive provider.\n\nRequirements\n------------\n**Chef 12.4.x+** is required. We are currently testing against 12.8.1. If you need Chef 11 support, please try pinning back to a version less than 2.0, e.g.:\n```\ndepends 'firewall', '< 2.0'\n```\n\n### Supported firewalls and platforms\n* UFW - Ubuntu, Debian\n* IPTables - Red Hat & CentOS, Ubuntu\n* FirewallD - Red Hat & CentOS >= 7.0 (IPv4 only support, [needs contributions/testing](https://github.com/chef-cookbooks/firewall/issues/86))\n* Windows Advanced Firewall - 2012 R2\n\nTested on:\n* Ubuntu 12.04, 14.04, 16.04 with iptables, ufw\n* Debian 7.8, 8.1 with ufw\n* CentOS 5.11, 6.7 with iptables\n* CentOS 7.1 with firewalld\n* Windows Server 2012r2 with Windows Advanced Firewall\n\nBy default, Ubuntu chooses ufw. To switch to iptables, set this in an attribute file:\n```\ndefault['firewall']['ubuntu_iptables'] = true\n```\n\nBy default, Red Hat & CentOS >= 7.0 chooses firewalld. To switch to iptables, set this in an attribute file:\n```\ndefault['firewall']['redhat7_iptables'] = true\n```\n\n# Considerations that apply to all firewall providers and resources\n\nThis cookbook comes with two resources, firewall and firewall rule. The typical usage scenario is as follows:\n\n- run the `:install` action on the `firewall` resource named 'default', which installs appropriate packages and configures services to start on boot and starts them\n\n- run the `:create` action on every `firewall_rule` resource, which adds to the list of rules that should be configured on the firewall. `firewall_rule` then automatically sends a delayed notification to the `firewall['default']` resource to run the `:restart` action.\n\n- run the delayed notification with action `:restart` on the `firewall` resource. if any rules are different than the last run, the provider will update the current state of the firewall rules to match the expected rules.\n\nThere is a fundamental mismatch between the idea of a chef action and the action that should be taken on a firewall rule. For this reason, the chef action for a firewall_rule may be `:nothing` (the rule should not be present in the firewall) or `:create` (the rule should be present in the firewall), but the action taken on a packet in a firewall (`DROP`, `ACCEPT`, etc) is denoted as a `command` parameter on the `firewall_rule` resource.\n\n# iptables considerations\n\nIf you need to use a table other than `*filter`, the best way to do so is like so:\n```\nnode.default['firewall']['iptables']['defaults'][:ruleset] = {\n '*filter' => 1,\n ':INPUT DROP' => 2,\n ':FORWARD DROP' => 3,\n ':OUTPUT ACCEPT_FILTER' => 4,\n 'COMMIT_FILTER' => 100,\n '*nat' => 101,\n ':PREROUTING DROP' => 102,\n ':POSTROUTING DROP' => 103,\n ':OUTPUT ACCEPT_NAT' => 104,\n 'COMMIT_NAT' => 200\n}\n```\n\nNote -- in order to support multiple hash keys containing the same rule, anything found after the underscore will be stripped for: `:OUTPUT :INPUT :POSTROUTING :PREROUTING COMMIT`. This allows an example like the above to be reduced to just repeated lines of `COMMIT` and `:OUTPUT ACCEPT` while still avoiding duplication of other things.\n\nThen it's trivial to add additional rules to the `*nat` table using the raw parameter:\n```\nfirewall_rule \"postroute\" do\n raw \"-A POSTROUTING -o eth1 -p tcp -d 172.28.128.21 -j SNAT --to-source 172.28.128.6\"\n position 150\nend\n```\n\nNote that any line starting with `COMMIT` will become just `COMMIT`, as hash\nkeys must be unique but we need multiple commit lines.\n\n# Recipes\n\n### default\nThe default recipe creates a firewall resource with action install.\n\n### disable_firewall\nUsed to disable platform specific firewall. Many clouds have their own firewall configured outside of the OS instance such as AWS Security Groups.\n\n# Attributes\n\n* `default['firewall']['allow_ssh'] = false`, set true to open port 22 for SSH when the default recipe runs\n* `default['firewall']['allow_mosh'] = false`, set to true to open UDP ports 60000 - 61000 for [Mosh][0] when the default recipe runs\n* `default['firewall']['allow_winrm'] = false`, set true to open port 5989 for WinRM when the default recipe runs\n* `default['firewall']['allow_loopback'] = falLine truncated
+1
View File
@@ -13,3 +13,4 @@ Gemfile.lock
\#*#
bin/*
metadata.json
Gemfile.lock
+26 -53
View File
@@ -4,58 +4,31 @@ driver_config:
require_chef_omnibus: true
platforms:
- name: ubuntu-14.04
driver_config:
box: opscode_ubuntu-14.04_provisionerless
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box
- name: ubuntu-12.04
driver_config:
box: opscode_ubuntu-12.04_provisionerless
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04_chef-provisionerless.box
- name: ubuntu-10.04
driver_config:
box: opscode_ubuntu-10.04_provisionerless
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-10.04_chef-provisionerless.box
- name: debian-6
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
- name: ubuntu-12.04
- name: ubuntu-14.04
- name: ubuntu-16.04
- name: debian-7.11
- name: debian-8.5
- name: centos-6.8
- name: centos-7.2
- name: freebsd-9.3
- name: freebsd-10.3
- name: fedora-21
- name: fedora-22
- name: fedora-23
- name: fedora-24
suites:
- name: default
run_list:
- recipe[hostname::default]
attributes:
set_fqdn: test.example.com
- name: wildcard
run_list:
- recipe[hostname::default]
provisioner:
solo_rb:
node_name: test
attributes:
set_fqdn: '*.example.com'
- name: default
run_list:
- recipe[hostname::default]
attributes:
set_fqdn: test.example.com
- name: wildcard
run_list:
- recipe[hostname::default]
provisioner:
solo_rb:
node_name: test
attributes:
set_fqdn: '*.example.com'
+1
View File
@@ -0,0 +1 @@
--color
+14 -3
View File
@@ -1,12 +1,23 @@
AllCops:
DisplayCopNames: true
Exclude:
- tmp/**
Documentation:
Lint/AmbiguousBlockAssociation:
Enabled: false
LineLength:
Metrics/BlockLength:
Enabled: false
SingleSpaceBeforeFirstArg:
Metrics/LineLength:
Enabled: false
Style/Documentation:
Exclude:
- Thorfile
Style/PercentLiteralDelimiters:
Enabled: false
Style/SingleSpaceBeforeFirstArg:
Enabled: false
+3 -2
View File
@@ -1,9 +1,10 @@
bundler_args: --without integration
before_script: bundle exec berks install
script: bundle exec strainer test
script: bundle exec rake
language: ruby
rvm:
- 1.9.3
- 2.3.1
sudo: false
notifications:
hipchat:
secure: ! 'mTePogP3SZVXbZ8l3o1yN+uszEEwQY3WgBXXXQc4hV1nLGhAXgjgj5ueCKAE
+2 -2
View File
@@ -1,8 +1,8 @@
# -*- ruby -*-
source "https://supermarket.getchef.com"
source 'https://supermarket.getchef.com'
metadata
group :integration do
cookbook "minitest-handler"
cookbook 'minitest-handler'
end
+13
View File
@@ -1,5 +1,18 @@
# 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)
==================
- #40: Use file resources with lazy eval and notifies to prevent network restarts from occurring on every chef run (Matt Kasa)
+3 -4
View File
@@ -1,14 +1,13 @@
source 'https://rubygems.org'
gem 'berkshelf'
gem 'chef', '~> 11.10'
gem 'chef', '~> 12.13'
gem 'chefspec'
gem 'foodcritic', '~> 3.0'
gem 'foodcritic'
gem 'rake'
gem 'strainer'
gem 'rubocop'
group :integration do
gem 'test-kitchen', '~> 1.0'
gem 'kitchen-vagrant'
gem 'test-kitchen'
end
+20
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.
+8
View File
@@ -1,5 +1,7 @@
# 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
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
`/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
+15
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]
-4
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
+3 -4
View File
@@ -13,13 +13,12 @@ And then, to install all cookbooks:
Local
-----
$ bundle exec strainer test
$ bundle exec rake
The above runs:
- rubocop
- `knife cookbook test` tests
- Food Critic lint
- rubocop lint
- Foodcritic lint
- Chefspec tests
Chefspec tests (the interesting part) are in `spec/`.
+4 -4
View File
@@ -6,12 +6,12 @@ require 'bundler/setup'
require 'shellwords'
class Cookbook < Thor
COOKBOOK_NAME = 'hostname'
COOKBOOK_CATEGORY = 'utilities'
COOKBOOK_NAME = 'hostname'.freeze
COOKBOOK_CATEGORY = 'utilities'.freeze
include Thor::Actions
desc :edit, "Edit cookbook in browser"
desc :edit, 'Edit cookbook in browser'
def edit
open "http://community.opscode.com/cookbooks/#{COOKBOOK_NAME}/edit"
end
@@ -35,7 +35,7 @@ class Cookbook < Thor
def open_cmd
@open_cmd ||= %w[open xdg-open].find do |command|
system "which #{command} >/dev/null 2>&1"
$?.success?
$CHILD_STATUS.success?
end
end
end
+4 -1
View File
@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
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
+6 -1
View File
@@ -6,10 +6,15 @@ maintainer_email 'maciej@3ofcoins.net'
license 'MIT'
description 'Configures hostname and FQDN'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.4.0'
version '0.4.2'
supports 'debian'
supports 'ubuntu'
supports 'freebsd'
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)
+22 -5
View File
@@ -31,7 +31,10 @@ if fqdn
fqdn =~ /^([^.]+)/
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'
directory '/etc/rc.conf.d' do
mode '0755'
@@ -56,7 +59,7 @@ if fqdn
notifies :reload, 'ohai[reload_hostname]', :immediately
end
when 'centos', 'redhat', 'amazon', 'scientific'
when 'rhel'
service 'network' do
action :nothing
end
@@ -66,6 +69,7 @@ if fqdn
content lazy {
::IO.read(hostfile).gsub(/^HOSTNAME=.*$/, "HOSTNAME=#{fqdn}")
}
not_if { ::IO.read(hostfile) =~ /^HOSTNAME=#{fqdn}$/ }
notifies :reload, 'ohai[reload_hostname]', :immediately
notifies :restart, 'service[network]', :delayed
end
@@ -73,10 +77,13 @@ if fqdn
sysctl = '/etc/sysctl.conf'
file sysctl do
action :create
regex = /^kernel\.hostname=.*/
newline = "kernel.hostname=#{hostname}"
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 :restart, 'service[network]', :delayed
end
@@ -84,6 +91,14 @@ if fqdn
only_if { node['hostname'] != hostname }
notifies :reload, 'ohai[reload_hostname]', :immediately
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
file '/etc/hostname' do
content "#{hostname}\n"
@@ -106,9 +121,11 @@ if fqdn
hostsfile_entry 'set hostname' do
ip_address node['hostname_cookbook']['hostsfile_ip']
hostname fqdn
aliases [hostname]
aliases aliases
unique true
action :create
notifies :reload, 'ohai[reload_hostname]', :immediately
only_if { node['hostname_cookbook']['append_hostsfile_ip'] }
end
ohai 'reload_hostname' do
+39 -13
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
*.bk
*.bkup
.kitchen.local.yml
Berksfile.lock
.bundle/
.cache/
.kitchen/
.vagrant/
.vagrant.d/
bin/
tmp/
vendor/
# RVM
# ruby/bundler files
.ruby-version
.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/
+16 -7
View File
@@ -1,12 +1,21 @@
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
driver:
name: vagrant
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:
- name: ubuntu-12.04
run_list:
- recipe[fake::prep]
- name: centos-6.7
- name: centos-6.8
- name: centos-7.3
# - name: debian-7.11
- name: debian-8.6
- name: fedora-25
- name: opensuse-leap-42.1
- name: ubuntu-14.04
- name: ubuntu-16.04
suites:
- name: default
-4
View File
@@ -1,4 +0,0 @@
AllCops:
Exclude:
- vendor/**
- .kitchen/**
+14 -4
View File
@@ -1,10 +1,20 @@
# Use Travis's cointainer based infrastructure
sudo: false
addons:
apt:
sources:
- chef-stable-precise
packages:
- chefdk
branches:
only:
- master
language: ruby
cache: bundler
rvm:
- 2.2
# Ensure we make ChefDK's Ruby the default
install: echo "Using ChefDK for all dependencies"
before_script:
- eval "$(/opt/chefdk/bin/chef shell-init bash)"
script:
- make travis
+2 -2
View File
@@ -1,7 +1,7 @@
source "https://supermarket.getchef.com"
source 'https://supermarket.chef.io'
metadata
group :development do
cookbook "fake", path: "test/fixtures/cookbooks/fake"
cookbook 'fake', path: 'test/fixtures/cookbooks/fake'
end
+28
View File
@@ -3,6 +3,34 @@ logrotate Cookbook CHANGELOG
This file is used to list changes made in each version of the
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
------
+5 -5
View File
@@ -16,7 +16,7 @@
### Requirements
- Ruby 2.0+
- Bundler (`gem install bundler`)
- Latest ChefDK
- [Vagrant](https://vagrantup.com)
- [VirtualBox](https://virtualbox.org)
@@ -24,15 +24,15 @@
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:
$ git checkout -b my_bug_fix
git checkout -b my_bug_fix
4. Make any changes
-11
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
-275
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
+8 -10
View File
@@ -1,13 +1,11 @@
travis: bundle berks
bundle exec chefstyle -D
bundle exec foodcritic .
bundle exec rspec --color --format doc
all: delivery
integration: bundle berks
bundle exec kitchen test
travis: debug_version_info all
bundle:
bundle install
debug_version_info:
/opt/chefdk/embedded/bin/chef --version
/opt/chefdk/embedded/bin/cookstyle --version
/opt/chefdk/embedded/bin/foodcritic --version
berks:
bundle exec berks install
delivery:
/opt/chefdk/bin/chef exec delivery local all
+12 -1
View File
@@ -6,11 +6,22 @@ application specific logrotate configuration.
## Requirements
### Platforms
Should work on any platform that includes a 'logrotate' package and
writes logrotate configuration to /etc/logrotate.d. Tested on Ubuntu
and Centos.
### Chef
- Chef 12.5+
### Cookbooks
- none
## Recipes
### global
@@ -118,7 +129,7 @@ The resource takes the following properties:
"logrotate.erb".
- `template_mode`: the mode to create the logrotate template with
(default: "0440")
(default: "0644")
- `template_owner`: the owner of the logrotate template (default:
"root")
+30 -29
View File
@@ -1,10 +1,10 @@
#
# Cookbook Name:: logrotate
# Cookbook:: logrotate
# Attribute:: default
#
# Copyright 2013, Chef Software, Inc
# Copyright 2015-2016, Steven Danna
# Copyright 2016, Bloomberg Finance L.P.
# Copyright:: 2013-2017, Chef Software, Inc
# Copyright:: 2015-2017, Steven Danna
# Copyright:: 2016-2017, Bloomberg Finance L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,36 +19,37 @@
# limitations under the License.
#
default["logrotate"]["package"] = {
"name" => "logrotate",
"source" => nil,
"version" => nil,
"provider" => nil,
default['logrotate']['package'] = {
'name' => 'logrotate',
'source' => nil,
'version' => nil,
'provider' => nil,
'action' => :upgrade,
}
default["logrotate"]["directory"] = "/etc/logrotate.d"
default["logrotate"]["cron"]["install"] = platform?("solaris2") || platform?("aix")
default["logrotate"]["cron"]["name"] = "logrotate"
default["logrotate"]["cron"]["command"] = "/usr/sbin/logrotate /etc/logrotate.conf"
default["logrotate"]["cron"]["minute"] = 35
default["logrotate"]["cron"]["hour"] = 2
default['logrotate']['directory'] = '/etc/logrotate.d'
default['logrotate']['cron']['install'] = platform?('solaris2') || platform?('aix')
default['logrotate']['cron']['name'] = 'logrotate'
default['logrotate']['cron']['command'] = '/usr/sbin/logrotate /etc/logrotate.conf'
default['logrotate']['cron']['minute'] = 35
default['logrotate']['cron']['hour'] = 2
default["logrotate"]["global"] = {
"weekly" => true,
"rotate" => 4,
"create" => "",
default['logrotate']['global'] = {
'weekly' => true,
'rotate' => 4,
'create' => '',
"/var/log/wtmp" => {
"missingok" => true,
"monthly" => true,
"create" => "0664 root utmp",
"rotate" => 1,
'/var/log/wtmp' => {
'missingok' => true,
'monthly' => true,
'create' => '0664 root utmp',
'rotate' => 1,
},
"/var/log/btmp" => {
"missingok" => true,
"monthly" => true,
"create" => "0660 root utmp",
"rotate" => 1,
'/var/log/btmp' => {
'missingok' => true,
'monthly' => true,
'create' => '0660 root utmp',
'rotate' => 1,
},
}
+102
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
@@ -1,8 +1,8 @@
#
# Cookbook Name:: logrotate
# Cookbook:: logrotate
# Library:: CookbookLogrotate
#
# Copyright 2013, Chef
# Copyright:: 2013-2017, Chef
#
# Licensed under the Apache License, Version 2.0 (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
module CookbookLogrotate
DIRECTIVES = %w{compress copy copytruncate daily dateext
dateyesterday delaycompress hourly ifempty mailfirst maillast
missingok monthly nocompress nocopy nocopytruncate nocreate nocreateolddir
nodelaycompress nodateext nomail nomissingok noolddir
nosharedscripts noshred notifempty renamecopy sharedscripts shred weekly
yearly} unless const_defined?(:DIRECTIVES)
DIRECTIVES = %w(compress copy copytruncate daily dateext
dateyesterday delaycompress hourly ifempty mailfirst maillast
missingok monthly nocompress nocopy nocopytruncate nocreate nocreateolddir
nodelaycompress nodateext nomail nomissingok noolddir
nosharedscripts noshred notifempty renamecopy sharedscripts shred weekly
yearly).freeze unless const_defined?(:DIRECTIVES)
VALUES = %w{compresscmd uncompresscmd compressext compressoptions
create createolddir dateformat include mail extension maxage minsize maxsize
rotate size shredcycles start tabooext su olddir} unless const_defined?(:VALUES)
VALUES = %w(compresscmd uncompresscmd compressext compressoptions
create createolddir dateformat include mail extension maxage minsize maxsize
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
class LogrotateConfiguration
attr_reader :directives, :values, :paths
attr_reader :directives, :values, :scripts, :paths
class << self
def from_hash(hash)
@@ -52,27 +52,23 @@ module CookbookLogrotate
end
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] = {
"directives" => directives_from(config),
"values" => values_from(config),
"scripts" => scripts_from(config),
'directives' => directives_from(config),
'values' => values_from(config),
'scripts' => scripts_from(config),
}
accum_paths
end
end
def scripts_from(hash)
defined_scripts = hash.select { |k| SCRIPTS.include?(k) }
defined_scripts.reduce({}) do |accum_scripts, (script, lines)|
if lines.respond_to?(:join)
accum_scripts[script] = lines.join("\n")
else
accum_scripts[script] = lines
end
accum_scripts
defined_scripts.each_with_object({}) do |(script, lines), accum_scripts|
accum_scripts[script] = if lines.respond_to?(:join)
lines.join("\n")
else
lines
end
end
end
end
@@ -82,6 +78,7 @@ module CookbookLogrotate
def initialize(hash)
@directives = LogrotateConfiguration.directives_from(hash)
@values = LogrotateConfiguration.values_from(hash)
@scripts = LogrotateConfiguration.scripts_from(hash)
@paths = LogrotateConfiguration.paths_from(hash)
end
end
@@ -1,4 +1,6 @@
if defined?(ChefSpec)
ChefSpec.define_matcher :logrotate_app
def enable_logrotate_app(resource)
ChefSpec::Matchers::ResourceMatcher.new(:logrotate_app, :enable, resource)
end
+5 -3
View File
@@ -16,7 +16,7 @@
"ubuntu": ">= 0.0.0"
},
"dependencies": {
"compat_resource": ">= 0.0.0"
},
"recommendations": {
@@ -42,12 +42,14 @@
"recipes": {
"logrotate": "Installs logrotate package"
},
"version": "2.1.0",
"version": "2.2.0",
"source_url": "https://github.com/stevendanna/logrotate",
"issues_url": "https://github.com/stevendanna/logrotate/issues",
"privacy": false,
"chef_versions": [
[
">= 12.5"
]
],
"ohai_versions": [
+14 -15
View File
@@ -1,19 +1,18 @@
name "logrotate"
maintainer "Steven Danna"
maintainer_email "steve@chef.io"
license "Apache 2.0"
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."
version "2.1.0"
name 'logrotate'
maintainer 'Steven Danna'
maintainer_email 'steve@chef.io'
license 'Apache 2.0'
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.'
version '2.2.0'
source_url "https://github.com/stevendanna/logrotate" if respond_to?(:source_url)
issues_url "https://github.com/stevendanna/logrotate/issues" if respond_to?(:issues_url)
recipe 'logrotate', 'Installs logrotate package'
provides 'logrotate_app'
recipe "logrotate", "Installs logrotate package"
provides "logrotate_app"
depends "compat_resource"
%w{amazon centos debian fedora redhat scientific solaris2 ubuntu}.each do |platform|
%w(amazon centos debian fedora redhat scientific solaris2 ubuntu).each do |platform|
supports platform
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)
+19 -19
View File
@@ -1,10 +1,10 @@
#
# Cookbook Name:: logrotate
# Cookbook:: logrotate
# Recipe:: default
#
# Copyright 2009-2013, Chef Software, Inc.
# Copyright 2015-2016, Steven Danna
# Copyright 2016, Bloomberg Finance L.P.
# Copyright:: 2009-2017, Chef Software, Inc.
# Copyright:: 2015-2017, Steven Danna
# Copyright:: 2016-2017, Bloomberg Finance L.P.
#
# Licensed under the Apache License, Version 2.0 (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
# limitations under the License.
#
return if platform?("windows")
return if platform?('windows')
package node["logrotate"]["package"]["name"] do
provider node["logrotate"]["package"]["provider"] if node["logrotate"]["package"]["provider"]
source node["logrotate"]["package"]["source"] if node["logrotate"]["package"]["source"]
version node["logrotate"]["package"]["version"] if node["logrotate"]["package"]["version"]
action :upgrade
package node['logrotate']['package']['name'] do
provider node['logrotate']['package']['provider'] if node['logrotate']['package']['provider']
source node['logrotate']['package']['source'] if node['logrotate']['package']['source']
version node['logrotate']['package']['version'] if node['logrotate']['package']['version']
action node['logrotate']['package']['action']
end
directory node["logrotate"]["directory"] do
owner "root"
group node["root_group"]
mode "0755"
directory node['logrotate']['directory'] do
owner 'root'
group node['root_group']
mode '0755'
end
if node["logrotate"]["cron"]["install"] # ~FC023
cron node["logrotate"]["cron"]["name"] do
minute node["logrotate"]["cron"]["minute"]
hour node["logrotate"]["cron"]["hour"]
command node["logrotate"]["cron"]["command"]
if node['logrotate']['cron']['install'] # ~FC023
cron node['logrotate']['cron']['name'] do
minute node['logrotate']['cron']['minute']
hour node['logrotate']['cron']['hour']
command node['logrotate']['cron']['command']
end
end
+8 -8
View File
@@ -1,8 +1,8 @@
#
# Cookbook Name:: logrotate
# Cookbook:: logrotate
# Recipe:: default
#
# Copyright 2009-2013, Chef Software, Inc.
# Copyright:: 2009-2017, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,14 +17,14 @@
# 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
source "logrotate-global.erb"
mode "0644"
template '/etc/logrotate.conf' do
source 'logrotate-global.erb'
mode '0644'
variables(
:configuration => parsed_configuration
configuration: parsed_configuration
)
end
+20 -20
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");
# you may not use this file except in compliance with the License.
@@ -17,20 +17,20 @@
resource_name :logrotate_app
property :path, [String, Array], required: true
property :frequency, String, default: "weekly"
property :cookbook, default: "logrotate"
property :template_name, default: "logrotate.erb"
property :template_mode, default: "0644"
property :template_owner, default: "root"
property :template_group, default: "root"
property :base_dir, String, default: "/etc/logrotate.d"
property :frequency, String, default: 'weekly'
property :cookbook, default: 'logrotate'
property :template_name, default: 'logrotate.erb'
property :template_mode, default: '0644'
property :template_owner, default: 'root'
property :template_group, default: 'root'
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
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
CookbookLogrotate::VALUES.each do |configurable_name|
@@ -42,15 +42,15 @@ property :sharedscripts, [TrueClass, FalseClass], default: false
property :enable, [TrueClass, FalseClass], default: true
action :enable do
if !new_resource.enable
Chef::Log.deprecation "Use `action :disable` rather than `enable false` in the logrotate_app resource"
unless new_resource.enable
Chef::Log.deprecation 'Use `action :disable` rather than `enable false` in the logrotate_app resource'
action_disable
return true
end
logrotate_config = {
# 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,
directives: handle_options(new_resource),
scripts: handle_scripts(new_resource),
@@ -58,9 +58,9 @@ action :enable do
}
directory new_resource.base_dir do
owner "root"
group node["root_group"]
mode "0755"
owner 'root'
group node['root_group']
mode '0755'
action :create
end
@@ -84,7 +84,7 @@ end
def handle_configurables(new_resource)
configurables = {}
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
end
end
@@ -94,7 +94,7 @@ end
def handle_scripts(new_resource)
scripts = {}
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
end
end
@@ -109,8 +109,8 @@ def handle_options(new_resource)
end
if new_resource.sharedscripts
Chef::Log.deprecation("The sharedscripts resource property is deprecated. Use the options property instead to set this value")
opts << "sharedscripts"
Chef::Log.deprecation('The sharedscripts resource property is deprecated. Use the options property instead to set this value')
opts << 'sharedscripts'
end
opts
end
@@ -9,6 +9,12 @@
<%= k %> <%= v %>
<% end -%>
<% @configuration.scripts.each do | scripttype, body | -%>
<%= scripttype %>
<%= body %>
endscript
<% end -%>
include /etc/logrotate.d
<% @configuration.paths.each do |path, path_config| -%>
+14
View File
@@ -2,6 +2,20 @@
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)
- Refactor mysql_service_manager_upstart.rb to eliminate use of cloned resource
-2
View File
@@ -36,8 +36,6 @@ The following platforms have been tested with Test Kitchen:
|----------------+-----+-----+-----+-----|
| fedora | | | X | X |
|----------------+-----+-----+-----+-----|
| openSUSE 13.2 | | | X | |
|----------------+-----+-----+-----+-----|
| openSUSE Leap | | | X | |
|----------------+-----+-----+-----+-----|
```
+5 -11
View File
@@ -22,11 +22,6 @@ module MysqlCookbook
false
end
def precise?
return true if node['platform'] == 'ubuntu' && node['platform_version'] == '12.04'
false
end
def trusty?
return true if node['platform'] == 'ubuntu' && node['platform_version'] == '14.04'
return true if node['platform'] == 'linuxmint' && node['platform_version'] =~ /^17\.[0-9]$/
@@ -60,14 +55,13 @@ module MysqlCookbook
# rhelish
return '5.1' if el6?
return '5.6' if el7?
return '5.5' if node['platform'] == 'amazon'
return '5.6' if node['platform'] == 'amazon'
# debian
return '5.5' if wheezy?
return '5.5' if jessie?
# ubuntu
return '5.5' if precise?
return '5.5' if trusty?
return '5.7' if xenial?
@@ -91,6 +85,8 @@ module MysqlCookbook
def default_client_package_name
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.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'
@@ -100,6 +96,8 @@ module MysqlCookbook
def default_server_package_name
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.6' if major_version == '5.6' && 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?
cmd
end
def sensitive_supported?
Gem::Version.new(Chef::VERSION) >= Gem::Version.new('11.14.0')
end
end
end
+1 -1
View File
@@ -42,7 +42,7 @@ module MysqlCookbook
mode '0640'
variables(new_resource.variables)
source new_resource.source
cookbook cookbook
cookbook new_resource.cookbook
action :create
end
end
+1 -1
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":[]}
+6
View File
@@ -2,6 +2,12 @@
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)
- Fix compatibility with Chef 12.5.1
+1 -1
View File
@@ -25,7 +25,7 @@ The `upgrade` recipe has been tested on the following platforms:
## Chef
- Chef 12.5+
- Chef 12.7+
## Cookbooks
+1 -1
View File
@@ -1 +1 @@
{"name":"openssl","version":"7.0.1","description":"Provides a library with a method for generating secure random passwords.","long_description":"# OpenSSL Cookbook\n\n[![Build Status](https://travis-ci.org/chef-cookbooks/openssl.svg?branch=master)](http://travis-ci.org/chef-cookbooks/openssl) [![Cookbook Version](https://img.shields.io/cookbook/v/openssl.svg)](https://supermarket.chef.io/cookbooks/openssl)\n\nThis cookbook provides tools for working with the Ruby OpenSSL library. It includes:\n\n- A library method to generate secure random passwords in recipes, using the Ruby SecureRandom library.\n- A resource for generating RSA private keys.\n- A resource for generating x509 certificates.\n- A resource for generating dhparam.pem files.\n- An attribute-driven recipe for upgrading OpenSSL packages.\n\n## Platforms\n\nThe `random_password` mixin works on any platform with the Ruby SecureRandom module. This module is already included with Chef.\n\nThe `openssl_x509`, `openssl_rsa_key` and `openssl_dhparam` resources work on any platform with the OpenSSL Ruby bindings installed. These bindings are already included with Chef.\n\nThe `upgrade` recipe has been tested on the following platforms:\n\n- Debian / Ubuntu derivatives\n- RHEL and derivatives\n- Fedora\n- openSUSE / SUSE Linux Enterprises\n\n## Chef\n\n- Chef 12.5+\n\n## Cookbooks\n\n- none\n\n## Attributes\n\n- `node['openssl']['restart_services']` - An array of service resources that depend on the openssl packages. This array is empty by default, as Chef has no reasonable way to detect which applications or services are compiled against these packages. _Note_ Each service listed in this array should represent a \"`service`\" resource specified in the recipes of the node's run list.\n\n## Recipes\n\n### default\n\nAn empty placeholder recipe. Takes no action.\n\n### upgrade\n\nThe upgrade recipe iterates over the list of packages in the `node['openssl']['packages']` attribute, and manages them with the `:upgrade` action. Each package will send a `:restart` notification to service resources named in the `node['openssl']['restart_services']` attribute.\n\n#### Example Usage\n\nIn this example, assume the node is running the `stats_collector` daemon, which depends on the openssl library. Imagine that a new openssl vulnerability has been disclosed, and the operating system vendor has released an update to openssl to address this vulnerability. In order to protect the node, an administrator crafts this recipe:\n\n```ruby\nnode.default['openssl']['restart_services'] = ['stats_collector']\n\n# other recipe code here...\nservice 'stats_collector' do\n action [:enable, :start]\nend\n\ninclude_recipe 'openssl::upgrade'\n```\n\nWhen executed, this recipe will ensure that openssl is upgraded to the latest version, and that the `stats_collector` service is restarted to pick up the latest security fixes released in the openssl package.\n\n## Libraries & Resources\n\nThere are two mixins packaged with this cookbook.\n\n### random_password (`OpenSSLCookbook::RandomPassword`)\n\nThe `RandomPassword` mixin can be used to generate secure random passwords in Chef cookbooks, usually for assignment to a variable or an attribute. `random_password` uses Ruby's SecureRandom library and is customizable.\n\n#### Example Usage\n\n```ruby\nChef::Recipe.send(:include, OpenSSLCookbook::RandomPassword)\nnode.normal['my_secure_attribute'] = random_password\nnode.normal_unless['my_secure_attribute'] = random_password\nnode.normal['my_secure_attribute'] = random_password(length: 50)\nnode.normal['my_secure_attribute'] = random_password(length: 50, mode: :base64)\nnode.normal['my_secure_attribute'] = random_password(length: 50, mode: :base64, encoding: 'ASCII')\n```\n\nNote that node attributes are widely accessible. Storing unencrypted passwords in node attributes, as in this example, carries risk.\n\n### ~~secure_password (`Opscode::OpenSSL::Password`)~~\n\nThis library should be considered deprecated and will be removed in a future version. Please use `OpenSSLCookbook::RandomPassword` instead. The documentation is kept here for historical reasons.\n\n#### ~~Example Usage~~\n\n```ruby\n::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)\nnode.normal_unless['my_password'] = secure_password\n```\n\n~~Note that node attributes are widely accessible. Storing unencrypted passwords in node attributes, as in this example, carries risk.~~\n\n### openssl_x509\n\nThis resource generates self-signed, PEM-formatted x509 certificates. If no existing key is specified, the resource will automatically generate a passwordless key with the certificate.\n\n#### Attributes\n\nName | Type | Description\n------------------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Line truncated
{"name":"openssl","version":"7.1.0","description":"Provides a library with a method for generating secure random passwords.","long_description":"# OpenSSL Cookbook\n\n[![Build Status](https://travis-ci.org/chef-cookbooks/openssl.svg?branch=master)](http://travis-ci.org/chef-cookbooks/openssl) [![Cookbook Version](https://img.shields.io/cookbook/v/openssl.svg)](https://supermarket.chef.io/cookbooks/openssl)\n\nThis cookbook provides tools for working with the Ruby OpenSSL library. It includes:\n\n- A library method to generate secure random passwords in recipes, using the Ruby SecureRandom library.\n- A resource for generating RSA private keys.\n- A resource for generating x509 certificates.\n- A resource for generating dhparam.pem files.\n- An attribute-driven recipe for upgrading OpenSSL packages.\n\n## Platforms\n\nThe `random_password` mixin works on any platform with the Ruby SecureRandom module. This module is already included with Chef.\n\nThe `openssl_x509`, `openssl_rsa_key` and `openssl_dhparam` resources work on any platform with the OpenSSL Ruby bindings installed. These bindings are already included with Chef.\n\nThe `upgrade` recipe has been tested on the following platforms:\n\n- Debian / Ubuntu derivatives\n- RHEL and derivatives\n- Fedora\n- openSUSE / SUSE Linux Enterprises\n\n## Chef\n\n- Chef 12.7+\n\n## Cookbooks\n\n- none\n\n## Attributes\n\n- `node['openssl']['restart_services']` - An array of service resources that depend on the openssl packages. This array is empty by default, as Chef has no reasonable way to detect which applications or services are compiled against these packages. _Note_ Each service listed in this array should represent a \"`service`\" resource specified in the recipes of the node's run list.\n\n## Recipes\n\n### default\n\nAn empty placeholder recipe. Takes no action.\n\n### upgrade\n\nThe upgrade recipe iterates over the list of packages in the `node['openssl']['packages']` attribute, and manages them with the `:upgrade` action. Each package will send a `:restart` notification to service resources named in the `node['openssl']['restart_services']` attribute.\n\n#### Example Usage\n\nIn this example, assume the node is running the `stats_collector` daemon, which depends on the openssl library. Imagine that a new openssl vulnerability has been disclosed, and the operating system vendor has released an update to openssl to address this vulnerability. In order to protect the node, an administrator crafts this recipe:\n\n```ruby\nnode.default['openssl']['restart_services'] = ['stats_collector']\n\n# other recipe code here...\nservice 'stats_collector' do\n action [:enable, :start]\nend\n\ninclude_recipe 'openssl::upgrade'\n```\n\nWhen executed, this recipe will ensure that openssl is upgraded to the latest version, and that the `stats_collector` service is restarted to pick up the latest security fixes released in the openssl package.\n\n## Libraries & Resources\n\nThere are two mixins packaged with this cookbook.\n\n### random_password (`OpenSSLCookbook::RandomPassword`)\n\nThe `RandomPassword` mixin can be used to generate secure random passwords in Chef cookbooks, usually for assignment to a variable or an attribute. `random_password` uses Ruby's SecureRandom library and is customizable.\n\n#### Example Usage\n\n```ruby\nChef::Recipe.send(:include, OpenSSLCookbook::RandomPassword)\nnode.normal['my_secure_attribute'] = random_password\nnode.normal_unless['my_secure_attribute'] = random_password\nnode.normal['my_secure_attribute'] = random_password(length: 50)\nnode.normal['my_secure_attribute'] = random_password(length: 50, mode: :base64)\nnode.normal['my_secure_attribute'] = random_password(length: 50, mode: :base64, encoding: 'ASCII')\n```\n\nNote that node attributes are widely accessible. Storing unencrypted passwords in node attributes, as in this example, carries risk.\n\n### ~~secure_password (`Opscode::OpenSSL::Password`)~~\n\nThis library should be considered deprecated and will be removed in a future version. Please use `OpenSSLCookbook::RandomPassword` instead. The documentation is kept here for historical reasons.\n\n#### ~~Example Usage~~\n\n```ruby\n::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)\nnode.normal_unless['my_password'] = secure_password\n```\n\n~~Note that node attributes are widely accessible. Storing unencrypted passwords in node attributes, as in this example, carries risk.~~\n\n### openssl_x509\n\nThis resource generates self-signed, PEM-formatted x509 certificates. If no existing key is specified, the resource will automatically generate a passwordless key with the certificate.\n\n#### Attributes\n\nName | Type | Description\n------------------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Line truncated
+1 -1
View File
@@ -20,7 +20,7 @@
case node['platform_family']
when 'debian', 'ubuntu'
packages = %w(libssl1.0.0 openssl)
when 'rhel', 'fedora', 'suse'
when 'rhel', 'fedora', 'suse', 'amazon'
packages = %w(openssl)
else
packages = []
+1 -1
View File
@@ -42,7 +42,7 @@ action :create do
end
end
action_class.class_eval do
action_class do
def generate_key_file
unless new_resource.key_file
path, file = ::File.split(new_resource.name)
+2
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
===========
+2 -2
View File
@@ -10,7 +10,7 @@ when "rhel", "fedora"
else
user = "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_fpm_name = "php7.0-fpm"
else
@@ -19,7 +19,7 @@ else
end
conf_dir = "#{php_conf_dir}/fpm/conf.d"
pool_conf_dir = "#{php_conf_dir}/fpm/pool.d"
if node.platform == "ubuntu" and node.platform_version.to_f <= 10.04
if node['platform'] == "ubuntu" and node['platform_version'].to_f <= 10.04
conf_file = "#{php_conf_dir}/fpm/php5-fpm.conf"
else
conf_file = "#{php_conf_dir}/fpm/php-fpm.conf"
+2 -2
View File
@@ -1,8 +1,8 @@
{
"name": "php-fpm",
"version": "0.7.8",
"version": "0.7.9",
"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_email": "cookbooks@opscode.com",
"license": "Apache 2.0",
+3 -3
View File
@@ -38,7 +38,7 @@ when 'debian'
# Configure Dotdeb repos
# TODO: move this to it's own 'dotdeb' cookbook?
# http://www.dotdeb.org/instructions/
if node.platform_version.to_f >= 8.0
if node['platform_version'].to_f >= 8.0
apt_repository "dotdeb" do
uri node['php-fpm']['dotdeb_repository']['uri']
distribution "jessie"
@@ -46,7 +46,7 @@ when 'debian'
key node['php-fpm']['dotdeb_repository']['key']
action :add
end
elsif node.platform_version.to_f >= 7.0
elsif node['platform_version'].to_f >= 7.0
apt_repository "dotdeb" do
uri node['php-fpm']['dotdeb_repository']['uri']
distribution "wheezy"
@@ -54,7 +54,7 @@ when 'debian'
key node['php-fpm']['dotdeb_repository']['key']
action :add
end
elsif node.platform_version.to_f >= 6.0
elsif node['platform_version'].to_f >= 6.0
apt_repository "dotdeb" do
uri node['php-fpm']['dotdeb_repository']['uri']
distribution "squeeze"
+37 -1
View File
@@ -2,7 +2,42 @@
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)
- Converted pear_channel LWRP into custom resource
- Removed use of pear node attribute from pear_channel resource
- 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.
- Rename php-test to standard cookbook testing cookbook of "test"
- 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)
+40 -96
View File
@@ -1,48 +1,58 @@
# 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)
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
### Platforms
- Debian, Ubuntu
- CentOS, Red Hat, Oracle, Scientific, Amazon Linux
- Fedora
- Microsoft Windows
### Chef
- Chef 12.1+
- Chef 12.7+
### Cookbooks
- build-essential
- xml
- mysql
- iis
- windows
## Attributes
- `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']['pear']` = Name of the pear executable to use, default `pear`.
The file also contains the following attribute types:
- platform specific locations and settings.
- source installation settings
## Resource/Provider
This cookbook includes LWRPs for managing:
- PEAR channels
- PEAR/PECL packages
### `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
- :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
- :remove: Remove a channel from the List
#### Attribute Parameters
- channel_name: name attribute. The name of the channel to discover
- channel_xml: the channel.xml file of the channel you are adding
- pear: pear binary, default: pear
@@ -77,17 +87,20 @@ end
```
### `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
- `: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
- `: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
- `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
- `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.
@@ -152,22 +165,25 @@ end
```
### `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).
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
- `:install`: Installs the FPM pool (default).
- `:uninstall`: Removes the FPM pool.
#### Attribute Parameters
- `pool_name`: name attribute. The name of the FPM pool.
- `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.
- `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
- `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
@@ -185,17 +201,23 @@ end
```
## Recipes
### 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
This recipe installs PHP from packages.
### source
This recipe installs PHP from source.
## Deprecated Recipes
The following recipes are deprecated and will be removed from a future version of this cookbook.
- `module_apc`
- `module_apcu`
- `module_curl`
@@ -209,7 +231,7 @@ The following recipes are deprecated and will be removed from a future version o
- `module_pgsql`
- `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
# using apt
@@ -224,9 +246,10 @@ end
```
## 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
name "php"
@@ -242,6 +265,7 @@ run_list(
```
## License & Authors
**Author:** Cookbook Engineering Team ([cookbooks@chef.io](mailto:cookbooks@chef.io))
**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
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>.
```
+23 -46
View File
@@ -2,7 +2,7 @@
# Cookbook:: php
# Attributes:: default
#
# Copyright:: 2011-2016, Chef Software, Inc.
# Copyright:: 2011-2017, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -25,10 +25,10 @@ default['php']['bin'] = 'php'
default['php']['pear'] = 'pear'
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']['checksum'] = '92acc6c067f5e015a6881b4119eafec10eca11722e810f2c2083f72e17119bcf'
default['php']['checksum'] = '8bc7d93e4c840df11e3d9855dcad15c1b7134e8acf0cf3b90b932baea2d0bde2'
default['php']['prefix_dir'] = '/usr/local'
default['php']['enable_mod'] = '/usr/sbin/php5enmod'
default['php']['disable_mod'] = '/usr/sbin/php5dismod'
@@ -46,7 +46,7 @@ default['php']['pgsql']['package'] = 'php5-pgsql'
default['php']['sqlite']['package'] = 'php5-sqlite3'
case node['platform_family']
when 'rhel', 'fedora'
when 'rhel', 'fedora', 'amazon'
lib_dir = node['kernel']['machine'] =~ /x86_64/ ? 'lib64' : 'lib'
default['php']['conf_dir'] = '/etc'
default['php']['ext_conf_dir'] = '/etc/php.d'
@@ -54,28 +54,25 @@ when 'rhel', 'fedora'
default['php']['fpm_group'] = 'nobody'
default['php']['fpm_listen_user'] = 'nobody'
default['php']['fpm_listen_group'] = 'nobody'
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_version'].to_f < 6
default['php']['packages'] = %w(php53 php53-devel php53-cli php-pear)
default['php']['mysql']['package'] = 'php53-mysql'
else # set fpm attributes as we're on a modern PHP release
default['php']['packages'] = if node['platform'] == 'amazon' # amazon names their packages with versions
%w(php56 php56-devel 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']['ext_dir'] = "/usr/#{lib_dir}/php/modules"
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)
default['php']['packages'] = %w(php56 php56-devel php-pear)
default['php']['fpm_package'] = 'php56-fpm'
else # redhat does not name their packages with version on RHEL 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 mhash-devel)
default['php']['packages'] = %w(php php-devel php-cli php-pear)
default['php']['fpm_package'] = 'php-fpm'
default['php']['fpm_pooldir'] = '/etc/php-fpm.d'
default['php']['fpm_default_conf'] = '/etc/php-fpm.d/www.conf'
default['php']['fpm_service'] = 'php-fpm'
if node['php']['install_method'] == 'package'
default['php']['fpm_user'] = 'apache'
default['php']['fpm_group'] = 'apache'
default['php']['fpm_listen_user'] = 'apache'
default['php']['fpm_listen_group'] = 'apache'
end
end
default['php']['mysql']['package'] = 'php-mysql'
default['php']['fpm_pooldir'] = '/etc/php-fpm.d'
default['php']['fpm_default_conf'] = '/etc/php-fpm.d/www.conf'
default['php']['fpm_service'] = 'php-fpm'
if node['php']['install_method'] == 'package'
default['php']['fpm_user'] = 'apache'
default['php']['fpm_group'] = 'apache'
default['php']['fpm_listen_user'] = 'apache'
default['php']['fpm_listen_group'] = 'apache'
end
when 'debian'
default['php']['conf_dir'] = '/etc/php5/cli'
@@ -120,8 +117,7 @@ when 'debian'
default['php']['ext_conf_dir'] = '/etc/php5/mods-available'
end
when 'debian'
case node['platform_version'].to_i
when 8
if node['platform_version'].to_i == 8
default['php']['ext_conf_dir'] = '/etc/php5/mods-available'
end
end
@@ -136,25 +132,6 @@ when 'suse'
default['php']['packages'] = %w(apache2-mod_php5 php5-pear)
default['php']['mysql']['package'] = 'php5-mysql'
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'
default['php']['conf_dir'] = '/usr/local/etc'
default['php']['ext_conf_dir'] = '/usr/local/etc/php'
File diff suppressed because it is too large. Load diff
-23
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
+1 -1
View File
@@ -1 +1 @@
{"name":"php","version":"3.0.0","description":"Installs and maintains php and php modules","long_description":"# php Cookbook\n[![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)\n\nIt 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.\n\n## Requirements\n### Platforms\n- Debian, Ubuntu\n- CentOS, Red Hat, Oracle, Scientific, Amazon Linux\n- Fedora\n- Microsoft Windows \n\n### Chef\n- Chef 12.1+\n\n### Cookbooks\n- build-essential\n- xml\n- mysql\n- iis\n- windows\n\n## Attributes\n- `node['php']['install_method']` = method to install php with, default `package`.\n- `node['php']['directives']` = Hash of directives and values to append to `php.ini`, default `{}`.\n\nThe file also contains the following attribute types:\n- platform specific locations and settings.\n- source installation settings\n\n## Resource/Provider\nThis cookbook includes LWRPs for managing:\n- PEAR channels\n- PEAR/PECL packages\n\n### `php_pear_channel`\n[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.\n\n#### Actions\n- :discover: Initialize a channel from its server.\n- :add: Add a channel to the channel list, usually only used to add private channels. Public channels are usually added using the `:discover` action\n- :update: Update an existing channel\n- :remove: Remove a channel from the List\n\n#### Attribute Parameters\n- channel_name: name attribute. The name of the channel to discover\n- channel_xml: the channel.xml file of the channel you are adding\n- pear: pear binary, default: pear\n\n#### Examples\n\n```ruby\n# discover the horde channel\nphp_pear_channel \"pear.horde.org\" do\n action :discover\nend\n\n# download xml then add the symfony channel\nremote_file \"#{Chef::Config[:file_cache_path]}/symfony-channel.xml\" do\n source \"http://pear.symfony-project.com/channel.xml\"\n mode 0644\nend\nphp_pear_channel \"symfony\" do\n channel_xml \"#{Chef::Config[:file_cache_path]}/symfony-channel.xml\"\n action :add\nend\n\n# update the main pear channel\nphp_pear_channel 'pear.php.net' do\n action :update\nend\n\n# update the main pecl channel\nphp_pear_channel 'pecl.php.net' do\n action :update\nend\n```\n\n### `php_pear`\n[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.\n\n#### Actions\n- `:install`: Install a pear package - if version is provided, install that specific version\n- `:upgrade`: Upgrade a pear package - if version is provided, upgrade to that specific version\n- `:remove`: Remove a pear package\n- `: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`\n\n#### Attribute Parameters\n- `package_name`: name attribute. The name of the pear package to install\n- version: the version of the pear package to install/upgrade. If no version is given latest is assumed.\n- `preferred_state`: PEAR by default installs stable packages only, this allows you to install pear packages in a devel, alpha or beta state\n- `directives`: extra extension directives (settings) for a pecl. on most platforms these usually get rendered into the extension's .ini file\n- `zend_extensions`: extension filenames which should be loaded with zend_extension.\n- o`ptions`: Add additional options to the underlying pear package command\n\n#### Examples\n\n```ruby\n# upgrade a pear\nphp_pear \"XML_RPC\" do\n action :upgrade\nend\n\n\n# install a specific version\nphp_pear \"XML_RPC\" do\n version \"1.5.4\"\n action :install\nend\n\n\n# install the mongodb pecl\nphp_pear \"mongo\" do\n action :install\nend\n\n# install the xdebug pecl\nphp_pear \"xdebug\" do\n # Specify that xdebug.so must be loaded as a zend extension\n zend_extensions ['xdebug.so']\n action :install\nend\n\n\n# install apc pecl with directives\nphp_pear \"apc\" do\n action :install\n directives(:shm_size => 128, :enable_cli => 1)\nend\n\n\n# install the beta version of Horde_Url\n# from the horde channel\nhc = php_pear_channel \"pear.horde.org\" do\n action :discover\nend\nphp_pear \"Horde_Url\" do\n prLine truncated
{"name":"php","version":"4.2.0","description":"Installs and maintains php and php modules","long_description":"# php Cookbook\n\n[![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)\n\nIt 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.\n\n## Requirements\n\n### Platforms\n\n- Debian, Ubuntu\n- CentOS, Red Hat, Oracle, Scientific, Amazon Linux\n- Fedora\n\n### Chef\n\n- Chef 12.7+\n\n### Cookbooks\n\n- build-essential\n- xml\n- mysql\n\n## Attributes\n\n- `node['php']['install_method']` = method to install php with, default `package`.\n- `node['php']['directives']` = Hash of directives and values to append to `php.ini`, default `{}`.\n- `node['php']['pear']` = Name of the pear executable to use, default `pear`.\n\nThe file also contains the following attribute types:\n\n- platform specific locations and settings.\n- source installation settings\n\n## Resource/Provider\n\nThis cookbook includes LWRPs for managing:\n\n- PEAR channels\n- PEAR/PECL packages\n\n### `php_pear_channel`\n\n[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.\n\n#### Actions\n\n- :discover: Initialize a channel from its server.\n- :add: Add a channel to the channel list, usually only used to add private channels. Public channels are usually added using the `:discover` action\n- :update: Update an existing channel\n- :remove: Remove a channel from the List\n\n#### Attribute Parameters\n\n- channel_name: name attribute. The name of the channel to discover\n- channel_xml: the channel.xml file of the channel you are adding\n- pear: pear binary, default: pear\n\n#### Examples\n\n```ruby\n# discover the horde channel\nphp_pear_channel \"pear.horde.org\" do\n action :discover\nend\n\n# download xml then add the symfony channel\nremote_file \"#{Chef::Config[:file_cache_path]}/symfony-channel.xml\" do\n source \"http://pear.symfony-project.com/channel.xml\"\n mode 0644\nend\nphp_pear_channel \"symfony\" do\n channel_xml \"#{Chef::Config[:file_cache_path]}/symfony-channel.xml\"\n action :add\nend\n\n# update the main pear channel\nphp_pear_channel 'pear.php.net' do\n action :update\nend\n\n# update the main pecl channel\nphp_pear_channel 'pecl.php.net' do\n action :update\nend\n```\n\n### `php_pear`\n\n[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.\n\n#### Actions\n\n- `:install`: Install a pear package - if version is provided, install that specific version\n- `:upgrade`: Upgrade a pear package - if version is provided, upgrade to that specific version\n- `:remove`: Remove a pear package\n- `: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`\n\n#### Attribute Parameters\n\n- `package_name`: name attribute. The name of the pear package to install\n- version: the version of the pear package to install/upgrade. If no version is given latest is assumed.\n- `preferred_state`: PEAR by default installs stable packages only, this allows you to install pear packages in a devel, alpha or beta state\n- `directives`: extra extension directives (settings) for a pecl. on most platforms these usually get rendered into the extension's .ini file\n- `zend_extensions`: extension filenames which should be loaded with zend_extension.\n- o`ptions`: Add additional options to the underlying pear package command\n\n#### Examples\n\n```ruby\n# upgrade a pear\nphp_pear \"XML_RPC\" do\n action :upgrade\nend\n\n\n# install a specific version\nphp_pear \"XML_RPC\" do\n version \"1.5.4\"\n action :install\nend\n\n\n# install the mongodb pecl\nphp_pear \"mongo\" do\n action :install\nend\n\n# install the xdebug pecl\nphp_pear \"xdebug\" do\n # Specify that xdebug.so must be loaded as a zend extension\n zend_extensions ['xdebug.so']\n action :install\nend\n\n\n# install apc pecl with directives\nphp_pear \"apc\" do\n action :install\n directives(:shm_size => 128, :enable_cli => 1)\nend\n\n\n# install the beta version of Horde_Url\n# from the horde channel\nhc = php_pear_channel \"pear.horde.org\Line truncated
-89
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
+4 -4
View File
@@ -3,7 +3,7 @@
# Cookbook:: php
# 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");
# 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
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)
@bin = node['php']['pear']
if pecl?
@@ -177,13 +177,13 @@ end
def enable_package(name)
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
def disable_package(name)
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
+1 -1
View File
@@ -4,7 +4,7 @@
# Cookbook:: php
# Recipe:: default
#
# Copyright:: 2009-2016, Chef Software, Inc.
# Copyright:: 2009-2017, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
+5 -6
View File
@@ -3,7 +3,7 @@
# Cookbook:: php
# Recipe:: ini
#
# Copyright:: 2011-2016, Chef Software, Inc.
# Copyright:: 2011-2017, Chef Software, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -21,10 +21,9 @@
template "#{node['php']['conf_dir']}/php.ini" do
source node['php']['ini']['template']
cookbook node['php']['ini']['cookbook']
unless platform?('windows')
owner 'root'
group node['root_group']
mode '0644'
end
owner 'root'
group node['root_group']
mode '0644'
manage_symlink_source true
variables(directives: node['php']['directives'])
end
+2 -2
View File
@@ -4,7 +4,7 @@
# Cookbook:: php
# 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");
# you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
#
case node['platform_family']
when 'rhel', 'fedora'
when 'rhel', 'fedora', 'amazon'
package %w(httpd-devel pcre pcre-devel)
php_pear 'APC' do
+2 -2
View File
@@ -4,7 +4,7 @@
# Cookbook:: php
# 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");
# you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
#
case node['platform_family']
when 'rhel', 'fedora'
when 'rhel', 'fedora', 'amazon'
package %w(httpd-devel pcre pcre-devel)
php_pear 'APCu' do
+1 -1
View File
@@ -4,7 +4,7 @@
# Cookbook:: php
# 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");
# you may not use this file except in compliance with the License.
+2 -2
View File
@@ -4,7 +4,7 @@
# Cookbook:: php
# 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");
# you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
#
case node['platform_family']
when 'rhel', 'fedora'
when 'rhel', 'fedora', 'amazon'
pearhub_chan = php_pear_channel 'pearhub.org' do
action :discover
end
+1 -2
View File
@@ -4,7 +4,7 @@
# Cookbook:: php
# 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");
# you may not use this file except in compliance with the License.
@@ -21,7 +21,6 @@
pkg = value_for_platform(
%w(centos redhat scientific fedora amazon oracle) => {
el5_range => 'php53-gd',
'default' => 'php-gd',
},
'freebsd' => {
Loaded 100 of 129 files, more files were not shown because too many files have changed in this diff. Show more