Permalink
Browse files

updating mysql/postfix/memcached cookbooks to latest versions

  • Loading branch information...
1 parent 8a4a503 commit 182c1765a93abba63ffd34d562c6877cb6de959e @mdxp committed Dec 30, 2011
@@ -1,37 +1,51 @@
-= DESCRIPTION:
+Description
+===========
-Installs memcached and provides a define to set up an instance of memcache via runit.
+Installs memcached and provides a define to set up an instance of
+memcache via runit.
-= REQUIREMENTS:
+Changes
+=======
-== Platform:
+## v0.10.4:
-Tested on Ubuntu 8.10-9.10. Uses the memcached init script by default. A runit service can be set up for instances using the included define.
+* Current released version
-== Cookbooks:
+Requirements
+============
-Opscode cookbooks, http://github.com/opscode/cookbooks/tree/master:
+Tested on Ubuntu 8.10-9.10. Uses the memcached init script by default.
+A runit service can be set up for instances using the
+`memcache_instance` definition.
+
+## Cookbooks:
* runit
-= ATTRIBUTES:
+Attributes
+==========
-The following are node attributes passed to the template for the runit service.
+The following are node attributes passed to the template for the runit
+service.
-* memcached[:memory] - maximum memory for memcached instances.
-* memcached[:user] - user to run memcached as.
-* memcached[:port] - port for memcached to listen on.
-* memcached[:listen] - IP address for memcached to listen on.
+* `memcached[:memory]` - maximum memory for memcached instances.
+* `memcached[:user]` - user to run memcached as.
+* `memcached[:port]` - port for memcached to listen on.
+* `memcached[:listen]` - IP address for memcached to listen on.
-= USAGE:
+Usage
+=====
Simply set the attributes and it will configure the /etc/memcached.conf file. If you want to use multiple memcached instances, you'll need to modify the recipe to disable the startup script and the template in the default recipe.
Use the define, memcached_instance, to set up a runit service for the named memcached instance.
memcached_instance "myproj"
-= LICENSE and AUTHOR:
+The recipe also reads in whether to start up memcached from a /etc/default/memcached "ENABLE_MEMCACHED" setting, which is "yes" by default.
+
+License and Author
+==================
Author:: Joshua Timberman (<joshua@opscode.com>)
Author:: Joshua Sierles (<joshua@37signals.com>)
@@ -2,7 +2,7 @@
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Installs memcached and provides a define to set up an instance of memcache via runit"
-long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.10.4"
depends "runit"
View
@@ -86,7 +86,17 @@ For more infromation on the compile vs execution phase of a Chef run:
Changes/Roadmap
===============
-## v1.2.0
+### v1.2.2
+
+* [COOK-826] mysql::server recipe doesn't quote password string
+* [COOK-834] Add 'scientific' and 'amazon' platforms to mysql cookbook
+
+### v1.2.1
+
+* [COOK-644] Mysql client cookbook 'package missing' error message is confusing
+* [COOK-645] RHEL6/CentOS6 - mysql cookbook contains 'skip-federated' directive which is unsupported on MySQL 5.1
+
+### v1.2.0
* [COOK-684] remove mysql_database LWRP
@@ -116,7 +126,6 @@ Changes/Roadmap
* [COOK-578] wrap root password in quotes
* [COOK-562] expose all tunables in my.cnf
-
License and Author
==================
@@ -21,7 +21,7 @@
default['mysql']['data_dir'] = "/var/lib/mysql"
case node["platform"]
-when "centos", "redhat", "fedora", "suse"
+when "centos", "redhat", "fedora", "suse", "scientific", "amazon"
set['mysql']['conf_dir'] = '/etc'
set['mysql']['socket'] = "/var/lib/mysql/mysql.sock"
set['mysql']['pid_file'] = "/var/run/mysqld/mysqld.pid"
View
@@ -3,13 +3,13 @@
license "Apache 2.0"
description "Installs and configures mysql for client or server"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "1.2.0"
+version "1.2.2"
recipe "mysql", "Includes the client recipe to configure a client"
recipe "mysql::client", "Installs packages required for mysql clients using run_action magic"
recipe "mysql::server", "Installs packages required for mysql servers w/o manual intervention"
recipe "mysql::server_ec2", "Performs EC2-specific mountpoint manipulation"
-%w{ debian ubuntu centos suse fedora redhat }.each do |os|
+%w{ debian ubuntu centos suse fedora redhat scientific amazon }.each do |os|
supports os
end
@@ -21,15 +21,15 @@
package "mysql-client" do
package_name value_for_platform(
- [ "centos", "redhat", "suse", "fedora"] => { "default" => "mysql" },
+ [ "centos", "redhat", "suse", "fedora", "scientific", "amazon"] => { "default" => "mysql" },
"default" => "mysql-client"
)
action :install
end
package "mysql-devel" do
package_name begin
- if platform?(%w{ centos redhat suse fedora })
+ if platform?(%w{ centos redhat suse fedora scientific amazon })
"mysql-devel"
elsif debian_before_squeeze? || ubuntu_before_lucid?
"libmysqlclient15-dev"
@@ -40,21 +40,12 @@
action :install
end
-if platform?(%w{ debian ubuntu redhat centos fedora suse })
-
- package "mysql-ruby" do
- package_name value_for_platform(
- [ "centos", "redhat", "suse", "fedora"] => { "default" => "ruby-mysql" },
- ["debian", "ubuntu"] => { "default" => 'libmysql-ruby' },
- "default" => 'libmysql-ruby'
- )
- action :install
- end
-
+if platform?(%w{ redhat centos fedora suse scientific amazon })
+ package 'ruby-mysql'
+elsif platform?(%w{ debian ubuntu })
+ package "libmysql-ruby"
else
-
gem_package "mysql" do
action :install
end
-
end
@@ -62,7 +62,7 @@
end
service "mysql" do
- service_name value_for_platform([ "centos", "redhat", "suse", "fedora" ] => {"default" => "mysqld"}, "default" => "mysql")
+ service_name value_for_platform([ "centos", "redhat", "suse", "fedora", "scientific", "amazon" ] => {"default" => "mysqld"}, "default" => "mysql")
if (platform?("ubuntu") && node.platform_version.to_f >= 10.04)
restart_command "restart mysql"
stop_command "stop mysql"
@@ -72,12 +72,22 @@
action :nothing
end
+skip_federated = case node['platform']
+ when 'fedora', 'ubuntu', 'amazon'
+ true
+ when 'centos', 'redhat', 'scientific'
+ node['platform_version'].to_f < 6.0
+ else
+ false
+ end
+
template "#{node['mysql']['conf_dir']}/my.cnf" do
source "my.cnf.erb"
owner "root"
group "root"
mode "0644"
notifies :restart, resources(:service => "mysql"), :immediately
+ variables :skip_federated => skip_federated
end
unless Chef::Config[:solo]
@@ -117,7 +127,7 @@
end
execute "mysql-install-privileges" do
- command "/usr/bin/mysql -u root #{node['mysql']['server_root_password'].empty? ? '' : '-p' }#{node['mysql']['server_root_password']} < #{grants_path}"
+ command "/usr/bin/mysql -u root #{node['mysql']['server_root_password'].empty? ? '' : '-p' }\"#{node['mysql']['server_root_password']}\" < #{grants_path}"
action :nothing
subscribes :run, resources("template[#{grants_path}]"), :immediately
end
@@ -29,9 +29,11 @@
not_if do FileTest.directory?(node['mysql']['ec2_path']) end
end
- directory node['mysql']['ec2_path'] do
- owner "mysql"
- group "mysql"
+ [node['mysql']['ec2_path'], node['mysql']['data_dir']].each do |dir|
+ directory dir do
+ owner "mysql"
+ group "mysql"
+ end
end
mount node['mysql']['data_dir'] do
@@ -113,8 +113,7 @@ max_binlog_size = <%= node['mysql']['tunable']['max_binlog_size'] %>
#skip-innodb
innodb_buffer_pool_size = <%= node['mysql']['tunable']['innodb_buffer_pool_size'] %>
-<% case node['platform'] -%>
-<% when "centos", "redhat", "fedora", "ubuntu" -%>
+<% if @skip_federated %>
#
# * Federated
#
@@ -158,7 +157,7 @@ key_buffer = <%= node['mysql']['tunable']['max_allowed_packet'] %>
# ndb-connectstring=127.0.0.1
<% case node['platform'] -%>
-<% when "centos", "redhat", "fedora", "suse" -%>
+<% when "centos", "redhat", "fedora", "suse", "scientific", "amazon"-%>
#
# * BerkeleyDB
#
Oops, something went wrong.

0 comments on commit 182c176

Please sign in to comment.