Update cookbooks and add wordpress cookbook

This commit is contained in:
Greg Karékinian
2016-02-19 18:09:49 +01:00
parent 9ba973e3ac
commit 820b0ab3f8
606 changed files with 22421 additions and 14084 deletions

View File

@@ -2,17 +2,45 @@ bluepill Cookbook CHANGELOG
===========================
This file is used to list changes made in each version of the bluepill cookbook.
2.4.1 (11-10-2015)
------
- Require rsyslog ~> 2.0.0 to preserve Chef 11 compatibility
- Fix rsyslog restarting on RHEL
- Use platform_family when setting platform specific node attributes and fix bad syntax. This should improve RHEL support
v2.4.0 (09-17-2015)
------
- Updated the LSB Required-Start and Required-Stop comments of the LSB init script template to be valid
- Added name to the bluepill_test cookbook metadata for Chef 12
- If a defaults file on RHEL or Debian based systems exist for the service source that within the init scripts. Example if /etc/default/bar exists on debian for the bar service then source that
- Added .kitchen.yml file with vagrant based testing for local testing and moved the cloud based kitchen to .kitchen.cloud.yml
- Add Travis CI config
- Added rubocop config
- Updated Berksfile to 3.X format and removed yum cookbook that wasn't used
- Updated contributing.md and added testing.md documentation
- Updated development and testing dependencies in the Gemfile
- Added maintainers.md and .toml and added Rake task for generating the MD file
- Opscode -> Chef Software everywhere
- Added Travis and cookbook version badges to the readme
- Add rake file to easy testing
- Resolved all Rubocop warnings
- Added a chefignore file and added additional files to the gitignore
- Added source_url and issues_url metadata for Supermarket
v2.3.2
------
- Never actually released
v2.3.1
------
### New Feature
- **[COOK-3705](https://tickets.opscode.com/browse/COOK-3705)** - Add init.d script with LSB style
- **[COOK-3705](https://tickets.chef.io/browse/COOK-3705)** - Add init.d script with LSB style
v2.3.0
------
### Improvement
- **[COOK-3503](https://tickets.opscode.com/browse/COOK-3503)** - Add why-run support
- **[COOK-3503](https://tickets.chef.io/browse/COOK-3503)** - Add why-run support
v2.2.2
------

View File

@@ -1,12 +1,23 @@
bluepill Cookbook
=================
Installs bluepill RubyGem and configures it to manage services. Also includes a LWRP.
[![Build Status](https://travis-ci.org/chef-cookbooks/bluepill.svg?branch=master)](https://travis-ci.org/chef-cookbooks/bluepill)
[![Cookbook Version](https://img.shields.io/cookbook/v/bluepill.svg)](https://supermarket.chef.io/cookbooks/bluepill)
Installs bluepill Ruby Gem and configures it to manage services. Also includes a LWRP.
Requirements
------------
#### Platforms
Bluepill is a pure Ruby service management tool/library, so this cookbook should work on any system. The attributes do set up paths based on FHS locations, see below.
#### Chef
- Chef 11+
#### Cookbooks
- none
Attributes
----------
@@ -68,11 +79,12 @@ See bluepill's documentation for more information on creating pill templates.
License & Authors
-----------------
- Author:: Joshua Timberman (<joshua@opscode.com>)
```text
Copyright 2010-2013, Opscode, Inc.
**Author:** Cookbook Engineering Team (<cookbooks@chef.io>)
**Copyright:** 2010-2015, 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

View File

@@ -1,7 +1,7 @@
# Cookbook Name:: bluepill
# Attributes:: default
#
# Copyright 2010, Opscode, Inc.
# Copyright 2010-2015, 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.
@@ -15,21 +15,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.
default["bluepill"]["bin"] = "#{node['languages']['ruby']['bin_dir']}/bluepill"
default["bluepill"]["logfile"] = "/var/log/bluepill.log"
default["bluepill"]["pid_dir"] = "/var/run/bluepill"
default["bluepill"]["state_dir"] = "/var/lib/bluepill"
default["bluepill"]["group"] = 0
default["bluepill"]["use_rsyslog"] = false
default['bluepill']['bin'] = "#{node['languages']['ruby']['bin_dir']}/bluepill"
default['bluepill']['logfile'] = '/var/log/bluepill.log'
default['bluepill']['pid_dir'] = '/var/run/bluepill'
default['bluepill']['state_dir'] = '/var/lib/bluepill'
default['bluepill']['group'] = 0
default['bluepill']['use_rsyslog'] = false
case platform
when "arch"
default["bluepill"]["init_dir"] = "/etc/rc.d"
default["bluepill"]["conf_dir"] = "/etc/bluepill"
when "freebsd"
default["bluepill"]["init_dir"] = "/usr/local/etc/rc.d"
default["bluepill"]["conf_dir"] = "/usr/local/etc/bluepill"
case node['platform_family']
when 'arch'
default['bluepill']['init_dir'] = '/etc/rc.d'
default['bluepill']['conf_dir'] = '/etc/bluepill'
default['bluepill']['defaults_dir'] = '/etc/default'
when 'freebsd'
default['bluepill']['init_dir'] = '/usr/local/etc/rc.d'
default['bluepill']['conf_dir'] = '/usr/local/etc/bluepill'
default['bluepill']['defaults_dir'] = '/etc/defaults'
else
default["bluepill"]["init_dir"] = "/etc/init.d"
default["bluepill"]["conf_dir"] = "/etc/bluepill"
default['bluepill']['init_dir'] = '/etc/init.d'
default['bluepill']['conf_dir'] = '/etc/bluepill'
end
case node['platform_family']
when 'fedora', 'rhel'
default['bluepill']['defaults_dir'] = '/etc/sysconfig'
when 'debian'
default['bluepill']['defaults_dir'] = '/etc/default'
end

View File

@@ -1,31 +1 @@
{
"name": "bluepill",
"version": "2.3.1",
"description": "Installs bluepill gem and configures to manage services, includes bluepill_service LWRP",
"long_description": "bluepill Cookbook\n=================\nInstalls bluepill RubyGem and configures it to manage services. Also includes a LWRP.\n\n\nRequirements\n------------\nBluepill is a pure Ruby service management tool/library, so this cookbook should work on any system. The attributes do set up paths based on FHS locations, see below.\n\n\nAttributes\n----------\nDefault locations for bluepill are in \"FHS compliant\" locations.\n\n* `node[\"bluepill\"][\"bin\"]` - Path to bluepill program, default is 'bluepill' in the RubyGems binary directory.\n* `node[\"bluepill\"][\"logfile\"]` - Location of the bluepill log file, default \"/var/log/bluepill.log\".\n* `node[\"bluepill\"][\"conf_dir\"]` - Location of service config files (pills), default \"/etc/bluepill\".\n* `node[\"bluepill\"][\"pid_dir\"]` - Location of pidfiles, default \"/var/run/bluepill\"\n* `node[\"bluepill\"][\"state_dir\"]` - Location of state directory, default \"/var/lib/bluepill\"\n* `node[\"bluepill\"][\"init_dir\"]` - Location of init script directory, default selected by platform.\n* `node[\"bluepill\"][\"version\"]` - Version of bluepill to install, default is latest.\n* `node[\"bluepill\"][\"use_rsyslog\"]` - Enable configuration and use of rsyslog for bluepill.\n\n\nResources/Providers\n-------------------\nThis cookbook contains an LWRP, `bluepill_service`. This can be used with the normal Chef service resource, by using the `provider` parameter, or by specifying the `bluepill_service` shortcut. These two resources are equivalent.\n\n```ruby\nservice 'my_app' do\n provider bluepill_service\n action [:enable, :load, :start]\nend\n\nbluepill_service 'my_app' do\n action [:enable, :load, :start]\nend\n```\n\nThe load action should probably always be specified, to ensure that if bluepill isn't running already it gets started. The\n\nThe recipe using the service must contain a template resource for the pill and it must be named `my_app.pill.erb`, where `my_app` is the service name passed to the bluepill service resource.\n\n\nUsage\n-----\nBe sure to include the bluepill recipe in the run list to ensure that the gem and bluepill-related directories are created. This will also make the cookbook available on the system and other cookbooks won't need to explicitly depend on it in the metadata.\n\nIf the default directory locations in the attributes/default.rb aren't what you want, change them by setting them either in the attributes file itself, or create attributes in a role applied to any systems that will use bluepill.\n\nExample pill template resource and .erb file:\n\n```ruby\ntemplate '/etc/bluepill/my_app.pill' do\n source 'my_app.pill.erb'\nend\n\nBluepill.application('my_app') do |app|\n app.process('my_app') do |process|\n process.pid_file = '/var/run/my_app.pid'\n process.start_command = '/usr/bin/my_app'\n end\nend\n```\n\nSee bluepill's documentation for more information on creating pill templates.\n\n\nLicense & Authors\n-----------------\n- Author:: Joshua Timberman (<joshua@opscode.com>)\n\n```text\nCopyright 2010-2013, 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```\n",
"maintainer": "Opscode, Inc.",
"maintainer_email": "cookbooks@opscode.com",
"license": "Apache 2.0",
"platforms": {
},
"dependencies": {
"rsyslog": ">= 0.0.0"
},
"recommendations": {
},
"suggestions": {
},
"conflicting": {
},
"providing": {
},
"replacing": {
},
"attributes": {
},
"groupings": {
},
"recipes": {
"bluepill::default": "Installs bluepill rubygem and set up management directories"
}
}
{"name":"bluepill","version":"2.4.1","description":"Installs bluepill gem and configures to manage services, includes bluepill_service LWRP","long_description":"bluepill Cookbook\n=================\n\n[![Build Status](https://travis-ci.org/chef-cookbooks/bluepill.svg?branch=master)](https://travis-ci.org/chef-cookbooks/bluepill)\n[![Cookbook Version](https://img.shields.io/cookbook/v/bluepill.svg)](https://supermarket.chef.io/cookbooks/bluepill)\n\nInstalls bluepill Ruby Gem and configures it to manage services. Also includes a LWRP.\n\n\nRequirements\n------------\n#### Platforms\nBluepill is a pure Ruby service management tool/library, so this cookbook should work on any system. The attributes do set up paths based on FHS locations, see below.\n\n#### Chef\n- Chef 11+\n\n#### Cookbooks\n- none\n\n\nAttributes\n----------\nDefault locations for bluepill are in \"FHS compliant\" locations.\n\n* `node[\"bluepill\"][\"bin\"]` - Path to bluepill program, default is 'bluepill' in the RubyGems binary directory.\n* `node[\"bluepill\"][\"logfile\"]` - Location of the bluepill log file, default \"/var/log/bluepill.log\".\n* `node[\"bluepill\"][\"conf_dir\"]` - Location of service config files (pills), default \"/etc/bluepill\".\n* `node[\"bluepill\"][\"pid_dir\"]` - Location of pidfiles, default \"/var/run/bluepill\"\n* `node[\"bluepill\"][\"state_dir\"]` - Location of state directory, default \"/var/lib/bluepill\"\n* `node[\"bluepill\"][\"init_dir\"]` - Location of init script directory, default selected by platform.\n* `node[\"bluepill\"][\"version\"]` - Version of bluepill to install, default is latest.\n* `node[\"bluepill\"][\"use_rsyslog\"]` - Enable configuration and use of rsyslog for bluepill.\n\n\nResources/Providers\n-------------------\nThis cookbook contains an LWRP, `bluepill_service`. This can be used with the normal Chef service resource, by using the `provider` parameter, or by specifying the `bluepill_service` shortcut. These two resources are equivalent.\n\n```ruby\nservice 'my_app' do\n provider bluepill_service\n action [:enable, :load, :start]\nend\n\nbluepill_service 'my_app' do\n action [:enable, :load, :start]\nend\n```\n\nThe load action should probably always be specified, to ensure that if bluepill isn't running already it gets started. The\n\nThe recipe using the service must contain a template resource for the pill and it must be named `my_app.pill.erb`, where `my_app` is the service name passed to the bluepill service resource.\n\n\nUsage\n-----\nBe sure to include the bluepill recipe in the run list to ensure that the gem and bluepill-related directories are created. This will also make the cookbook available on the system and other cookbooks won't need to explicitly depend on it in the metadata.\n\nIf the default directory locations in the attributes/default.rb aren't what you want, change them by setting them either in the attributes file itself, or create attributes in a role applied to any systems that will use bluepill.\n\nExample pill template resource and .erb file:\n\n```ruby\ntemplate '/etc/bluepill/my_app.pill' do\n source 'my_app.pill.erb'\nend\n\nBluepill.application('my_app') do |app|\n app.process('my_app') do |process|\n process.pid_file = '/var/run/my_app.pid'\n process.start_command = '/usr/bin/my_app'\n end\nend\n```\n\nSee bluepill's documentation for more information on creating pill templates.\n\n\nLicense & Authors\n-----------------\n\n**Author:** Cookbook Engineering Team (<cookbooks@chef.io>)\n\n**Copyright:** 2010-2015, 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","maintainer":"Chef Software, Inc.","maintainer_email":"cookbooks@chef.io","license":"Apache 2.0","platforms":{},"dependencies":{"rsyslog":"~> 2.0"},"recommendations":{},"suggestions":{},"conflicting":{},"providing":{},"replacing":{},"attributes":{},"groupings":{},"recipes":{"bluepill::default":"Installs bluepill rubygem and sets up management directories"}}

View File

@@ -1,10 +0,0 @@
name "bluepill"
maintainer "Opscode, Inc."
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Installs bluepill gem and configures to manage services, includes bluepill_service LWRP"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "2.3.1"
recipe "bluepill::default", "Installs bluepill rubygem and set up management directories"
depends "rsyslog"

View File

@@ -2,7 +2,7 @@
# Cookbook Name:: bluepill
# Provider:: service
#
# Copyright 2010, Opscode, Inc.
# Copyright 2010-2015, Chef Software, Inc.
# Copyright 2012, Heavy Water Operations, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -31,31 +31,30 @@ action :enable do
config_file = ::File.join(node['bluepill']['conf_dir'],
"#{new_resource.service_name}.pill")
unless @current_resource.enabled
converge_by("enable #{ @new_resource }") do
converge_by("enable #{@new_resource}") do
link "#{node['bluepill']['init_dir']}/#{new_resource.service_name}" do
to node['bluepill']['bin']
only_if { ::File.exists?(config_file) }
only_if { ::File.exist?(config_file) }
end
template_suffix = case node['platform_family']
when "rhel", "fedora", "freebsd" then node['platform_family']
when 'rhel', 'fedora', 'freebsd' then node['platform_family']
when 'debian' then 'lsb'
else nil
end
template "#{node['bluepill']['init_dir']}/bluepill-#{new_resource.service_name}" do
source "bluepill_init.#{template_suffix}.erb"
cookbook "bluepill"
owner "root"
cookbook 'bluepill'
owner 'root'
group node['bluepill']['group']
mode "0755"
mode '0755'
variables(
:service_name => new_resource.service_name,
:config_file => config_file
)
service_name: new_resource.service_name,
config_file: config_file
)
end if template_suffix
service "bluepill-#{new_resource.service_name}" do
action [ :enable ]
action [:enable]
end
end
end
@@ -63,14 +62,14 @@ end
action :load do
unless @current_resource.running
converge_by("load #{ @new_resource }") do
converge_by("load #{@new_resource}") do
shell_out!(load_command)
end
end
end
action :reload do
converge_by("reload #{ @new_resource }") do
converge_by("reload #{@new_resource}") do
shell_out!(stop_command) if @current_resource.running
shell_out!(load_command)
end
@@ -78,7 +77,7 @@ end
action :start do
unless @current_resource.running
converge_by("start #{ @new_resource }") do
converge_by("start #{@new_resource}") do
shell_out!(start_command)
end
end
@@ -86,7 +85,7 @@ end
action :disable do
if @current_resource.enabled
converge_by("disable #{ @new_resource }") do
converge_by("disable #{@new_resource}") do
file "#{node['bluepill']['conf_dir']}/#{new_resource.service_name}.pill" do
action :delete
end
@@ -99,7 +98,7 @@ end
action :stop do
if @current_resource.running
converge_by("stop #{ @new_resource }") do
converge_by("stop #{@new_resource}") do
shell_out!(stop_command)
end
end
@@ -107,7 +106,7 @@ end
action :restart do
if @current_resource.running
converge_by("restart #{ @new_resource }") do
converge_by("restart #{@new_resource}") do
Chef::Log.debug "Restarting #{new_resource.service_name}"
shell_out!(restart_command)
Chef::Log.debug "Restarted #{new_resource.service_name}"
@@ -154,20 +153,18 @@ def determine_current_status!
end
def service_running?
begin
if shell_out(status_command).exitstatus == 0
@current_resource.running true
Chef::Log.debug("#{new_resource} is running")
end
rescue Mixlib::ShellOut::ShellCommandFailed, SystemCallError
@current_resource.running false
nil
if shell_out(status_command).exitstatus == 0
@current_resource.running true
Chef::Log.debug("#{new_resource} is running")
end
rescue Mixlib::ShellOut::ShellCommandFailed, SystemCallError
@current_resource.running false
nil
end
def service_enabled?
if ::File.exists?("#{node['bluepill']['conf_dir']}/#{new_resource.service_name}.pill") &&
::File.symlink?("#{node['bluepill']['init_dir']}/#{new_resource.service_name}")
if ::File.exist?("#{node['bluepill']['conf_dir']}/#{new_resource.service_name}.pill") &&
::File.symlink?("#{node['bluepill']['init_dir']}/#{new_resource.service_name}")
@current_resource.enabled true
else
@current_resource.enabled false

View File

@@ -2,7 +2,7 @@
# Cookbook Name:: bluepill
# Recipe:: default
#
# Copyright 2010, Opscode, Inc.
# Copyright 2010-2015, 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,32 +17,29 @@
# limitations under the License.
#
gem_package "i18n" do
action :install
end
gem_package 'i18n'
gem_package "bluepill" do
version node["bluepill"]["version"] if node["bluepill"]["version"]
action :install
gem_package 'bluepill' do
version node['bluepill']['version'] if node['bluepill']['version']
end
[
node["bluepill"]["conf_dir"],
node["bluepill"]["pid_dir"],
node["bluepill"]["state_dir"]
node['bluepill']['conf_dir'],
node['bluepill']['pid_dir'],
node['bluepill']['state_dir']
].each do |dir|
directory dir do
recursive true
owner "root"
group node["bluepill"]["group"]
owner 'root'
group node['bluepill']['group']
end
end
file node["bluepill"]["logfile"] do
owner "root"
group node["bluepill"]["group"]
mode "0755"
file node['bluepill']['logfile'] do
owner 'root'
group node['bluepill']['group']
mode '0755'
action :create_if_missing
end
include_recipe "bluepill::rsyslog" if node['bluepill']['use_rsyslog']
include_recipe 'bluepill::rsyslog' if node['bluepill']['use_rsyslog']

View File

@@ -2,7 +2,7 @@
# Cookbook Name:: bluepill
# Recipe:: rsyslog
#
# Copyright 2010, Opscode, Inc.
# Copyright 2010-2015, 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,12 +17,12 @@
# limitations under the License.
#
include_recipe "rsyslog"
include_recipe 'rsyslog::default'
template "/etc/rsyslog.d/bluepill.conf" do
owner "root"
group "root"
mode 0644
source "bluepill_rsyslog.conf.erb"
notifies :restart, "service[rsyslog]"
template '/etc/rsyslog.d/bluepill.conf' do
owner 'root'
group 'root'
mode '0644'
source 'bluepill_rsyslog.conf.erb'
notifies :restart, "service[#{node['rsyslog']['service_name']}]"
end

View File

@@ -2,7 +2,7 @@
# Cookbook Name:: bluepill
# Resource:: service
#
# Copyright 2010, Opscode, Inc.
# Copyright 2010-2015, 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,8 +20,8 @@
actions :start, :stop, :enable, :disable, :load, :restart, :reload
default_action :start
attribute :service_name, :name_attribute => true
attribute :enabled, :default => false
attribute :running, :default => false
attribute :variables, :kind_of => Hash
attribute :supports, :default => { :restart => true, :status => true }
attribute :service_name, name_attribute: true
attribute :enabled, default: false
attribute :running, default: false
attribute :variables, kind_of: Hash
attribute :supports, default: { restart: true, status: true }

View File

@@ -12,6 +12,8 @@ BLUEPILL_BIN=<%= node['bluepill']['bin'] %>
BLUEPILL_CONFIG=<%= @config_file %>
SERVICE_NAME=<%= @service_name %>
[ -r <%= node['bluepill']['defaults_dir'] %>/$SERVICE_NAME ] && . <%= node['bluepill']['defaults_dir'] %>/$SERVICE_NAME
case "$1" in
start)
echo "Loading bluepill configuration for $SERVICE_NAME "

View File

@@ -24,6 +24,7 @@ status_cmd="${command} ${name} status"
stop_cmd="${command} ${name} stop"
stop_postcmd="${command} ${name} quit"
[ -r <%= node['bluepill']['defaults_dir'] %>/$name ] && . <%= node['bluepill']['defaults_dir'] %>/$name
load_rc_config ${name}
PATH="${PATH}:/usr/local/bin"

View File

@@ -2,7 +2,8 @@
#
### BEGIN INIT INFO
# Provides: <%= @service_name %>
# Required-Start: bar
# Required-Start:
# Required-Stop:
# Defalt-Start: 2 3 4 5
# Default-Stop: 0 1 2 6
# Description: Bluepill loader for <%= @service_name %>
@@ -12,6 +13,8 @@ BLUEPILL_BIN=<%= node['bluepill']['bin'] %>
BLUEPILL_CONFIG=<%= @config_file %>
SERVICE_NAME=<%= @service_name %>
[ -r <%= node['bluepill']['defaults_dir'] %>/$SERVICE_NAME ] && . <%= node['bluepill']['defaults_dir'] %>/$SERVICE_NAME
case "$1" in
start)
echo "Loading bluepill configuration for $SERVICE_NAME "

View File

@@ -12,6 +12,8 @@ BLUEPILL_BIN=<%= node['bluepill']['bin'] %>
BLUEPILL_CONFIG=<%= @config_file %>
SERVICE_NAME=<%= @service_name %>
[ -r <%= node['bluepill']['defaults_dir'] %>/$SERVICE_NAME ] && . <%= node['bluepill']['defaults_dir'] %>/$SERVICE_NAME
case "$1" in
start)
echo "Loading bluepill configuration for $SERVICE_NAME "