fast_food 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +73 -0
- data/Rakefile +8 -0
- data/chef/.chef/bootstrap/chef-solo.erb +27 -0
- data/chef/.chef/knife.rb +8 -0
- data/chef/.gitignore +1 -0
- data/chef/README +3 -0
- data/chef/cookbooks/README +1 -0
- data/chef/cookbooks/apache2/.gitignore +1 -0
- data/chef/cookbooks/apache2/CHANGELOG.md +81 -0
- data/chef/cookbooks/apache2/CONTRIBUTING +29 -0
- data/chef/cookbooks/apache2/Gemfile +10 -0
- data/chef/cookbooks/apache2/LICENSE +201 -0
- data/chef/cookbooks/apache2/README.md +373 -0
- data/chef/cookbooks/apache2/attributes/default.rb +149 -0
- data/chef/cookbooks/apache2/attributes/mod_auth_openid.rb +32 -0
- data/chef/cookbooks/apache2/definitions/apache_conf.rb +26 -0
- data/chef/cookbooks/apache2/definitions/apache_module.rb +53 -0
- data/chef/cookbooks/apache2/definitions/apache_site.rb +43 -0
- data/chef/cookbooks/apache2/definitions/web_app.rb +49 -0
- data/chef/cookbooks/apache2/files/default/apache2_module_conf_generate.pl +41 -0
- data/chef/cookbooks/apache2/files/default/tests/minitest/default_test.rb +64 -0
- data/chef/cookbooks/apache2/files/default/tests/minitest/helpers.rb +36 -0
- data/chef/cookbooks/apache2/files/default/tests/minitest/mod_auth_openid_test.rb +25 -0
- data/chef/cookbooks/apache2/files/default/tests/minitest/mod_dav_svn_test.rb +16 -0
- data/chef/cookbooks/apache2/files/default/tests/minitest/mod_perl_test.rb +22 -0
- data/chef/cookbooks/apache2/files/default/tests/minitest/mod_php5_test.rb +19 -0
- data/chef/cookbooks/apache2/files/default/tests/minitest/mod_python_test.rb +14 -0
- data/chef/cookbooks/apache2/files/default/tests/minitest/mod_ssl_test.rb +19 -0
- data/chef/cookbooks/apache2/files/default/tests/minitest/mod_wsgi_test.rb +14 -0
- data/chef/cookbooks/apache2/files/default/tests/minitest/mod_xsendfile_test.rb +14 -0
- data/chef/cookbooks/apache2/files/default/tests/minitest/modules_test.rb +19 -0
- data/chef/cookbooks/apache2/metadata.json +511 -0
- data/chef/cookbooks/apache2/metadata.rb +205 -0
- data/chef/cookbooks/apache2/recipes/default.rb +221 -0
- data/chef/cookbooks/apache2/recipes/god_monitor.rb +33 -0
- data/chef/cookbooks/apache2/recipes/mod_alias.rb +22 -0
- data/chef/cookbooks/apache2/recipes/mod_apreq2.rb +45 -0
- data/chef/cookbooks/apache2/recipes/mod_auth_basic.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_auth_digest.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_auth_openid.rb +113 -0
- data/chef/cookbooks/apache2/recipes/mod_authn_file.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_authnz_ldap.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_authz_default.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_authz_groupfile.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_authz_host.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_authz_user.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_autoindex.rb +22 -0
- data/chef/cookbooks/apache2/recipes/mod_cgi.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_dav.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_dav_fs.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_dav_svn.rb +29 -0
- data/chef/cookbooks/apache2/recipes/mod_deflate.rb +22 -0
- data/chef/cookbooks/apache2/recipes/mod_dir.rb +22 -0
- data/chef/cookbooks/apache2/recipes/mod_env.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_expires.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_fastcgi.rb +26 -0
- data/chef/cookbooks/apache2/recipes/mod_fcgid.rb +53 -0
- data/chef/cookbooks/apache2/recipes/mod_headers.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_ldap.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_log_config.rb +24 -0
- data/chef/cookbooks/apache2/recipes/mod_logio.rb +24 -0
- data/chef/cookbooks/apache2/recipes/mod_mime.rb +22 -0
- data/chef/cookbooks/apache2/recipes/mod_negotiation.rb +22 -0
- data/chef/cookbooks/apache2/recipes/mod_perl.rb +39 -0
- data/chef/cookbooks/apache2/recipes/mod_php5.rb +99 -0
- data/chef/cookbooks/apache2/recipes/mod_proxy.rb +22 -0
- data/chef/cookbooks/apache2/recipes/mod_proxy_ajp.rb +21 -0
- data/chef/cookbooks/apache2/recipes/mod_proxy_balancer.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_proxy_connect.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_proxy_http.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_python.rb +32 -0
- data/chef/cookbooks/apache2/recipes/mod_rewrite.rb +20 -0
- data/chef/cookbooks/apache2/recipes/mod_setenvif.rb +22 -0
- data/chef/cookbooks/apache2/recipes/mod_ssl.rb +43 -0
- data/chef/cookbooks/apache2/recipes/mod_status.rb +22 -0
- data/chef/cookbooks/apache2/recipes/mod_wsgi.rb +27 -0
- data/chef/cookbooks/apache2/recipes/mod_xsendfile.rb +27 -0
- data/chef/cookbooks/apache2/templates/default/a2dismod.erb +22 -0
- data/chef/cookbooks/apache2/templates/default/a2dissite.erb +29 -0
- data/chef/cookbooks/apache2/templates/default/a2enmod.erb +37 -0
- data/chef/cookbooks/apache2/templates/default/a2ensite.erb +38 -0
- data/chef/cookbooks/apache2/templates/default/apache2.conf.erb +237 -0
- data/chef/cookbooks/apache2/templates/default/apache2.god.erb +19 -0
- data/chef/cookbooks/apache2/templates/default/charset.erb +6 -0
- data/chef/cookbooks/apache2/templates/default/default-site.erb +57 -0
- data/chef/cookbooks/apache2/templates/default/mods/README +2 -0
- data/chef/cookbooks/apache2/templates/default/mods/alias.conf.erb +24 -0
- data/chef/cookbooks/apache2/templates/default/mods/authopenid.load.erb +1 -0
- data/chef/cookbooks/apache2/templates/default/mods/autoindex.conf.erb +101 -0
- data/chef/cookbooks/apache2/templates/default/mods/deflate.conf.erb +16 -0
- data/chef/cookbooks/apache2/templates/default/mods/dir.conf.erb +5 -0
- data/chef/cookbooks/apache2/templates/default/mods/fastcgi.conf.erb +5 -0
- data/chef/cookbooks/apache2/templates/default/mods/fcgid.conf.erb +10 -0
- data/chef/cookbooks/apache2/templates/default/mods/mime.conf.erb +198 -0
- data/chef/cookbooks/apache2/templates/default/mods/negotiation.conf.erb +18 -0
- data/chef/cookbooks/apache2/templates/default/mods/php5.conf.erb +16 -0
- data/chef/cookbooks/apache2/templates/default/mods/proxy.conf.erb +19 -0
- data/chef/cookbooks/apache2/templates/default/mods/setenvif.conf.erb +28 -0
- data/chef/cookbooks/apache2/templates/default/mods/ssl.conf.erb +76 -0
- data/chef/cookbooks/apache2/templates/default/mods/status.conf.erb +26 -0
- data/chef/cookbooks/apache2/templates/default/port_apache.erb +2 -0
- data/chef/cookbooks/apache2/templates/default/ports.conf.erb +6 -0
- data/chef/cookbooks/apache2/templates/default/security.erb +50 -0
- data/chef/cookbooks/apache2/templates/default/web_app.conf.erb +43 -0
- data/chef/cookbooks/build-essential/.gitignore +4 -0
- data/chef/cookbooks/build-essential/CHANGELOG.md +31 -0
- data/chef/cookbooks/build-essential/CONTRIBUTING +29 -0
- data/chef/cookbooks/build-essential/Gemfile +3 -0
- data/chef/cookbooks/build-essential/LICENSE +201 -0
- data/chef/cookbooks/build-essential/README.md +129 -0
- data/chef/cookbooks/build-essential/attributes/default.rb +33 -0
- data/chef/cookbooks/build-essential/metadata.json +41 -0
- data/chef/cookbooks/build-essential/metadata.rb +14 -0
- data/chef/cookbooks/build-essential/recipes/default.rb +92 -0
- data/chef/cookbooks/database/.gitignore +1 -0
- data/chef/cookbooks/database/CHANGELOG.md +46 -0
- data/chef/cookbooks/database/CONTRIBUTING +29 -0
- data/chef/cookbooks/database/LICENSE +201 -0
- data/chef/cookbooks/database/README.md +468 -0
- data/chef/cookbooks/database/libraries/provider_database_mysql.rb +103 -0
- data/chef/cookbooks/database/libraries/provider_database_mysql_user.rb +76 -0
- data/chef/cookbooks/database/libraries/provider_database_postgresql.rb +131 -0
- data/chef/cookbooks/database/libraries/provider_database_postgresql_user.rb +83 -0
- data/chef/cookbooks/database/libraries/provider_database_sql_server.rb +109 -0
- data/chef/cookbooks/database/libraries/provider_database_sql_server_user.rb +106 -0
- data/chef/cookbooks/database/libraries/resource_database.rb +119 -0
- data/chef/cookbooks/database/libraries/resource_database_user.rb +90 -0
- data/chef/cookbooks/database/libraries/resource_mysql_database.rb +34 -0
- data/chef/cookbooks/database/libraries/resource_mysql_database_user.rb +34 -0
- data/chef/cookbooks/database/libraries/resource_postgresql_database.rb +35 -0
- data/chef/cookbooks/database/libraries/resource_postgresql_database_user.rb +35 -0
- data/chef/cookbooks/database/libraries/resource_sql_server_database.rb +34 -0
- data/chef/cookbooks/database/libraries/resource_sql_server_database_user.rb +34 -0
- data/chef/cookbooks/database/metadata.json +45 -0
- data/chef/cookbooks/database/metadata.rb +22 -0
- data/chef/cookbooks/database/recipes/default.rb +20 -0
- data/chef/cookbooks/database/recipes/ebs_backup.rb +89 -0
- data/chef/cookbooks/database/recipes/ebs_volume.rb +204 -0
- data/chef/cookbooks/database/recipes/master.rb +78 -0
- data/chef/cookbooks/database/recipes/mysql.rb +20 -0
- data/chef/cookbooks/database/recipes/postgresql.rb +20 -0
- data/chef/cookbooks/database/recipes/snapshot.rb +62 -0
- data/chef/cookbooks/database/templates/default/app_grants.sql.erb +8 -0
- data/chef/cookbooks/database/templates/default/aws_config.erb +3 -0
- data/chef/cookbooks/database/templates/default/chef-solo-database-snapshot.cron.erb +6 -0
- data/chef/cookbooks/database/templates/default/chef-solo-database-snapshot.json.erb +1 -0
- data/chef/cookbooks/database/templates/default/chef-solo-database-snapshot.rb.erb +6 -0
- data/chef/cookbooks/database/templates/default/ebs-backup-cron.erb +2 -0
- data/chef/cookbooks/database/templates/default/ebs-db-backup.sh.erb +8 -0
- data/chef/cookbooks/database/templates/default/ebs-db-restore.sh.erb +10 -0
- data/chef/cookbooks/database/templates/default/s3cfg.erb +27 -0
- data/chef/cookbooks/fast_food/recipes/default.rb +24 -0
- data/chef/cookbooks/fast_food/recipes/site.rb +7 -0
- data/chef/cookbooks/fast_food/templates/default/web_app.conf.erb +43 -0
- data/chef/cookbooks/git/CHANGELOG.md +49 -0
- data/chef/cookbooks/git/CONTRIBUTING +29 -0
- data/chef/cookbooks/git/LICENSE +201 -0
- data/chef/cookbooks/git/README.md +115 -0
- data/chef/cookbooks/git/attributes/default.rb +37 -0
- data/chef/cookbooks/git/metadata.json +48 -0
- data/chef/cookbooks/git/metadata.rb +20 -0
- data/chef/cookbooks/git/recipes/default.rb +46 -0
- data/chef/cookbooks/git/recipes/server.rb +38 -0
- data/chef/cookbooks/git/recipes/source.rb +48 -0
- data/chef/cookbooks/git/recipes/windows.rb +32 -0
- data/chef/cookbooks/git/templates/default/sv-git-daemon-log-run.erb +2 -0
- data/chef/cookbooks/git/templates/default/sv-git-daemon-run.erb +3 -0
- data/chef/cookbooks/imagemagick/README.md +57 -0
- data/chef/cookbooks/imagemagick/metadata.json +37 -0
- data/chef/cookbooks/imagemagick/metadata.rb +14 -0
- data/chef/cookbooks/imagemagick/recipes/default.rb +25 -0
- data/chef/cookbooks/imagemagick/recipes/devel.rb +32 -0
- data/chef/cookbooks/imagemagick/recipes/rmagick.rb +22 -0
- data/chef/cookbooks/mysql/.gitignore +5 -0
- data/chef/cookbooks/mysql/CHANGELOG.md +125 -0
- data/chef/cookbooks/mysql/CONTRIBUTING +29 -0
- data/chef/cookbooks/mysql/Gemfile +8 -0
- data/chef/cookbooks/mysql/LICENSE +201 -0
- data/chef/cookbooks/mysql/README.md +227 -0
- data/chef/cookbooks/mysql/attributes/client.rb +50 -0
- data/chef/cookbooks/mysql/attributes/server.rb +240 -0
- data/chef/cookbooks/mysql/files/default/tests/minitest/server_test.rb +36 -0
- data/chef/cookbooks/mysql/files/default/tests/minitest/support/helpers.rb +11 -0
- data/chef/cookbooks/mysql/libraries/helpers.rb +33 -0
- data/chef/cookbooks/mysql/metadata.json +418 -0
- data/chef/cookbooks/mysql/metadata.rb +140 -0
- data/chef/cookbooks/mysql/recipes/client.rb +59 -0
- data/chef/cookbooks/mysql/recipes/default.rb +20 -0
- data/chef/cookbooks/mysql/recipes/ruby.rb +36 -0
- data/chef/cookbooks/mysql/recipes/server.rb +221 -0
- data/chef/cookbooks/mysql/recipes/server_ec2.rb +51 -0
- data/chef/cookbooks/mysql/templates/default/debian.cnf.erb +12 -0
- data/chef/cookbooks/mysql/templates/default/grants.sql.erb +15 -0
- data/chef/cookbooks/mysql/templates/default/my.cnf.erb +312 -0
- data/chef/cookbooks/mysql/templates/default/mysql-server.seed.erb +10 -0
- data/chef/cookbooks/mysql/templates/default/port_mysql.erb +3 -0
- data/chef/cookbooks/mysql/templates/windows/my.cnf.erb +61 -0
- data/chef/cookbooks/openssl/README.md +37 -0
- data/chef/cookbooks/openssl/libraries/secure_password.rb +37 -0
- data/chef/cookbooks/openssl/metadata.json +30 -0
- data/chef/cookbooks/openssl/metadata.rb +8 -0
- data/chef/cookbooks/openssl/recipes/default.rb +19 -0
- data/chef/cookbooks/passenger_apache2/.gitignore +4 -0
- data/chef/cookbooks/passenger_apache2/CHANGELOG.md +29 -0
- data/chef/cookbooks/passenger_apache2/CONTRIBUTING +29 -0
- data/chef/cookbooks/passenger_apache2/Gemfile +3 -0
- data/chef/cookbooks/passenger_apache2/LICENSE +201 -0
- data/chef/cookbooks/passenger_apache2/README.md +77 -0
- data/chef/cookbooks/passenger_apache2/attributes/default.rb +5 -0
- data/chef/cookbooks/passenger_apache2/metadata.json +38 -0
- data/chef/cookbooks/passenger_apache2/metadata.rb +17 -0
- data/chef/cookbooks/passenger_apache2/recipes/default.rb +60 -0
- data/chef/cookbooks/passenger_apache2/recipes/mod_rails.rb +47 -0
- data/chef/cookbooks/passenger_apache2/templates/default/passenger.conf.erb +3 -0
- data/chef/cookbooks/passenger_apache2/templates/default/passenger.load.erb +1 -0
- data/chef/cookbooks/passenger_apache2/templates/default/passenger_web_app.conf.erb +32 -0
- data/chef/cookbooks/passenger_apache2/templates/default/web_app.conf.erb +32 -0
- data/chef/roles/apache2.rb +12 -0
- data/chef/roles/mysql.rb +18 -0
- data/chef/solo.rb +5 -0
- data/config/deploy/centos.sh +17 -0
- data/config/deploy/production.rb +3 -0
- data/config/deploy/ubuntu.sh +10 -0
- data/config/deploy.rb +99 -0
- data/config/deployment.yml +6 -0
- data/fast_food.gemspec +26 -0
- data/lib/fast_food/railtie.rb +9 -0
- data/lib/fast_food/version.rb +3 -0
- data/lib/fast_food.rb +5 -0
- data/lib/tasks/fast_food.rake +100 -0
- data/spec/lib/fast_food_spec.rb +0 -0
- data/spec/spec_helper.rb +1 -0
- metadata +349 -0
@@ -0,0 +1,227 @@
|
|
1
|
+
Description
|
2
|
+
===========
|
3
|
+
|
4
|
+
Installs and configures MySQL client or server.
|
5
|
+
|
6
|
+
Requirements
|
7
|
+
============
|
8
|
+
|
9
|
+
Chef 0.10.10+.
|
10
|
+
|
11
|
+
Platform
|
12
|
+
--------
|
13
|
+
|
14
|
+
* Debian, Ubuntu
|
15
|
+
* CentOS, Red Hat, Fedora
|
16
|
+
* Mac OS X (Using homebrew)
|
17
|
+
|
18
|
+
Tested on:
|
19
|
+
|
20
|
+
* Debian 5.0, 6.0
|
21
|
+
* Ubuntu 10.04-12.04
|
22
|
+
* CentOS 5.5-5.8, 6.2-6.3
|
23
|
+
* Mac OS X 10.7.2
|
24
|
+
|
25
|
+
Cookbooks
|
26
|
+
---------
|
27
|
+
|
28
|
+
Requires Opscode's openssl cookbook for secure password generation.
|
29
|
+
See _Attributes_ and _Usage_ for more information.
|
30
|
+
|
31
|
+
The RubyGem installation in the `mysql::ruby` recipe requires a C
|
32
|
+
compiler and Ruby development headers to be installed in order to
|
33
|
+
build the mysql gem.
|
34
|
+
|
35
|
+
Requires `homebrew`
|
36
|
+
[cookbook](http://community.opscode.com/cookbooks/homebrew) on Mac OS
|
37
|
+
X.
|
38
|
+
|
39
|
+
Resources and Providers
|
40
|
+
=======================
|
41
|
+
|
42
|
+
The LWRP that used to ship as part of this cookbook has been
|
43
|
+
refactored into the
|
44
|
+
[database](http://community.opscode.com/cookbooks/database)
|
45
|
+
cookbook. Please see the README for details on updated usage.
|
46
|
+
|
47
|
+
Attributes
|
48
|
+
==========
|
49
|
+
|
50
|
+
See the `attributes/server.rb` or `attributes/client.rb` for default
|
51
|
+
values. Several attributes have values that vary based on the node's
|
52
|
+
platform and version.
|
53
|
+
|
54
|
+
* `node['mysql']['client']['packages']` - An array of package names
|
55
|
+
that should be installed on "client" systems. This can be modified,
|
56
|
+
e.g., to specify packages for Percona.
|
57
|
+
* `node['mysql']['server']['packages']` - An array of package names
|
58
|
+
that should be installed on "server" systems. This can be modified,
|
59
|
+
e.g., to specify packages for Percona.
|
60
|
+
|
61
|
+
* `node['mysql']['auto-increment-increment']` -
|
62
|
+
auto-increment-increment value in my.cnf
|
63
|
+
* `node['mysql']['auto-increment-offset]` - auto-increment-offset
|
64
|
+
value in my.cnf
|
65
|
+
* `node['mysql']['basedir']` - Base directory where MySQL is installed
|
66
|
+
* `node['mysql']['bind_address']` - Listen address for MySQLd
|
67
|
+
* `node['mysql']['conf_dir']` - Location for mysql conf directory
|
68
|
+
* `node['mysql']['confd_dir']` - Location for mysql conf.d style
|
69
|
+
include directory
|
70
|
+
* `node['mysql']['data_dir']` - Location for mysql data directory
|
71
|
+
* `node['mysql']['ec2_path']` - location of mysql data_dir on EC2
|
72
|
+
nodes
|
73
|
+
* `node['mysql']['grants_path']` - Path where the grants.sql should be
|
74
|
+
written
|
75
|
+
* `node['mysql']['mysqladmin_bin']` - Path to the mysqladmin binary
|
76
|
+
* `node['mysql']['old_passwords']` - Sets the `old_passwords` value in
|
77
|
+
my.cnf.
|
78
|
+
* `node['mysql']['pid_file']` - Path to the mysqld.pid file
|
79
|
+
* `node['mysql']['port']` - Liten port for MySQLd
|
80
|
+
* `node['mysql']['reload_action']` - Action to take when mysql conf
|
81
|
+
files are modified. Also allows "reload" and "none".
|
82
|
+
* `node['mysql']['root_group']` - The default group of the "root" user
|
83
|
+
* `node['mysql']['service_name']` - The name of the mysqld service
|
84
|
+
* `node['mysql']['socket']` - Path to the mysqld.sock file
|
85
|
+
* `node['mysql']['use_upstart']` - Whether to use upstart for the
|
86
|
+
service provider
|
87
|
+
|
88
|
+
Performance and other "tunable" attributes are under the
|
89
|
+
`node['mysql']['tunable']` attribute, corresponding to the same-named
|
90
|
+
parameter in my.cnf, and the default values are used. See
|
91
|
+
`attributes/server.rb`.
|
92
|
+
|
93
|
+
The following attributes are randomly generated passwords handled in
|
94
|
+
the `mysql::server` recipe, using the OpenSSL cookbook's
|
95
|
+
`secure_password` helper method. These are set using the `set_unless`
|
96
|
+
node attribute method, which allows them to be easily overridden e.g.
|
97
|
+
in a role.
|
98
|
+
|
99
|
+
* `node['mysql']['server_root_password']` - Set the server's root
|
100
|
+
password
|
101
|
+
* `node['mysql']['server_repl_password']` - Set the replication user
|
102
|
+
'repl' password
|
103
|
+
* `node['mysql']['server_debian_password']` - Set the debian-sys-maint
|
104
|
+
user password
|
105
|
+
|
106
|
+
## Windows Specific
|
107
|
+
|
108
|
+
The following attributes are specific to Windows platforms.
|
109
|
+
|
110
|
+
* `node['mysql']['client']['version']` - The version of MySQL
|
111
|
+
connector to install.
|
112
|
+
* `node['mysql']['client']['arch']` - Force 32 bit to work with the
|
113
|
+
mysql gem
|
114
|
+
* `node['mysql']['client']['package_file']` - The MSI file for the
|
115
|
+
mysql connector.
|
116
|
+
* `node['mysql']['client']['url']` - URL to download the mysql
|
117
|
+
connector.
|
118
|
+
* `node['mysql']['client']['packages']` - Similar to other platforms,
|
119
|
+
this is the name of the client package.
|
120
|
+
* `node['mysql']['client']['basedir']` - Base installation location
|
121
|
+
* `node['mysql']['client']['lib_dir']` - Libraries under the base location
|
122
|
+
* `node['mysql']['client']['bin_dir']` - binary directory under base location
|
123
|
+
* `node['mysql']['client']['ruby_dir']` - location where the Ruby
|
124
|
+
binaries will be
|
125
|
+
|
126
|
+
Usage
|
127
|
+
=====
|
128
|
+
|
129
|
+
On client nodes, use the client (or default) recipe:
|
130
|
+
|
131
|
+
{ "run_list": ["recipe[mysql::client]"] }
|
132
|
+
|
133
|
+
This will install the MySQL client libraries and development headers
|
134
|
+
on the system.
|
135
|
+
|
136
|
+
On nodes which may use the `database` cookbook's mysql resources, also
|
137
|
+
use the ruby recipe. This installs the mysql RubyGem in the Ruby
|
138
|
+
environment Chef is using via `chef_gem`.
|
139
|
+
|
140
|
+
{ "run_list": ["recipe[mysql::client]", "recipe[mysql::ruby]"] }
|
141
|
+
|
142
|
+
If you need to install the mysql Ruby library as a package for your
|
143
|
+
system, override the client packages attribute in your node or role.
|
144
|
+
For example, on an Ubuntu system:
|
145
|
+
|
146
|
+
{
|
147
|
+
"mysql": {
|
148
|
+
"client": {
|
149
|
+
"packages": ["mysql-client", "libmysqlclient-dev","ruby-mysql"]
|
150
|
+
}
|
151
|
+
}
|
152
|
+
}
|
153
|
+
|
154
|
+
This creates a resource object for the package and does the
|
155
|
+
installation before other recipes are parsed. You'll need to have the
|
156
|
+
C compiler and such (ie, build-essential on Ubuntu) before running the
|
157
|
+
recipes, but we already do that when installing Chef :-).
|
158
|
+
|
159
|
+
On server nodes, use the server recipe:
|
160
|
+
|
161
|
+
{ "run_list": ["recipe[mysql::server]"] }
|
162
|
+
|
163
|
+
On Debian and Ubuntu, this will preseed the mysql-server package with
|
164
|
+
the randomly generated root password in the recipe file. On other
|
165
|
+
platforms, it simply installs the required packages. It will also
|
166
|
+
create an SQL file, `/etc/mysql/grants.sql`, that will be used to set up
|
167
|
+
grants for the root, repl and debian-sys-maint users.
|
168
|
+
|
169
|
+
The recipe will perform a `node.save` unless it is run under
|
170
|
+
`chef-solo` after the password attributes are used to ensure that in
|
171
|
+
the event of a failed run, the saved attributes would be used.
|
172
|
+
|
173
|
+
On EC2 nodes, use the `server_ec2` recipe and the mysql data dir will
|
174
|
+
be set up in the ephmeral storage.
|
175
|
+
|
176
|
+
{ "run_list": ["recipe[mysql::server_ec2]"] }
|
177
|
+
|
178
|
+
When the `ec2_path` doesn't exist we look for a mounted filesystem
|
179
|
+
(eg, EBS) and move the data_dir there.
|
180
|
+
|
181
|
+
The client recipe is already included by server and 'default' recipes.
|
182
|
+
|
183
|
+
For more infromation on the compile vs execution phase of a Chef run:
|
184
|
+
|
185
|
+
* http://wiki.opscode.com/display/chef/Anatomy+of+a+Chef+Run
|
186
|
+
|
187
|
+
Chef Solo Note
|
188
|
+
==============
|
189
|
+
|
190
|
+
These node attributes are stored on the Chef
|
191
|
+
server when using `chef-client`. Because `chef-solo` does not
|
192
|
+
connect to a server or save the node object at all, to have the same
|
193
|
+
passwords persist across `chef-solo` runs, you must specify them in
|
194
|
+
the `json_attribs` file used. For example:
|
195
|
+
|
196
|
+
{
|
197
|
+
"mysql": {
|
198
|
+
"server_root_password": "iloverandompasswordsbutthiswilldo",
|
199
|
+
"server_repl_password": "iloverandompasswordsbutthiswilldo",
|
200
|
+
"server_debian_password": "iloverandompasswordsbutthiswilldo"
|
201
|
+
},
|
202
|
+
"run_list":["recipe[mysql::server]"]
|
203
|
+
}
|
204
|
+
|
205
|
+
License and Author
|
206
|
+
==================
|
207
|
+
|
208
|
+
- Author:: Joshua Timberman (<joshua@opscode.com>)
|
209
|
+
- Author:: AJ Christensen (<aj@opscode.com>)
|
210
|
+
- Author:: Seth Chisamore (<schisamo@opscode.com>)
|
211
|
+
- Author:: Brian Bianco (<brian.bianco@gmail.com>)
|
212
|
+
- Author:: Jesse Howarth (<him@jessehowarth.com>)
|
213
|
+
- Author:: Andrew Crump (<andrew@kotirisoftware.com>)
|
214
|
+
|
215
|
+
Copyright:: 2009-2012 Opscode, Inc
|
216
|
+
|
217
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
218
|
+
you may not use this file except in compliance with the License.
|
219
|
+
You may obtain a copy of the License at
|
220
|
+
|
221
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
222
|
+
|
223
|
+
Unless required by applicable law or agreed to in writing, software
|
224
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
225
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
226
|
+
See the License for the specific language governing permissions and
|
227
|
+
limitations under the License.
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: mysql
|
3
|
+
# Attributes:: client
|
4
|
+
#
|
5
|
+
# Copyright 2008-2009, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
# Include Opscode helper in Node class to get access
|
20
|
+
# to debian_before_squeeze? and ubuntu_before_lucid?
|
21
|
+
::Chef::Node.send(:include, Opscode::Mysql::Helpers)
|
22
|
+
|
23
|
+
case node['platform_family']
|
24
|
+
when "rhel", "suse", "fedora"
|
25
|
+
default['mysql']['client']['packages'] = %w{mysql mysql-devel}
|
26
|
+
when "debian"
|
27
|
+
if debian_before_squeeze? || ubuntu_before_lucid?
|
28
|
+
default['mysql']['client']['packages'] = %w{mysql-client libmysqlclient15-dev}
|
29
|
+
else
|
30
|
+
default['mysql']['client']['packages'] = %w{mysql-client libmysqlclient-dev}
|
31
|
+
end
|
32
|
+
when "freebsd"
|
33
|
+
default['mysql']['client']['packages'] = %w{mysql55-client}
|
34
|
+
when "windows"
|
35
|
+
default['mysql']['client']['version'] = "6.0.2"
|
36
|
+
default['mysql']['client']['arch'] = "win32" # force 32 bit to work with mysql gem
|
37
|
+
default['mysql']['client']['package_file'] = "mysql-connector-c-#{mysql['client']['version']}-#{mysql['client']['arch']}.msi"
|
38
|
+
default['mysql']['client']['url'] = "http://www.mysql.com/get/Downloads/Connector-C/#{mysql['client']['package_file']}/from/http://mysql.mirrors.pair.com/"
|
39
|
+
default['mysql']['client']['packages'] = ["MySQL Connector C #{mysql['client']['version']}"]
|
40
|
+
|
41
|
+
default['mysql']['client']['basedir'] = "#{ENV['SYSTEMDRIVE']}\\Program Files (x86)\\MySQL\\#{mysql['client']['packages'].first}"
|
42
|
+
default['mysql']['client']['lib_dir'] = "#{mysql['client']['basedir']}\\lib/opt"
|
43
|
+
default['mysql']['client']['bin_dir'] = "#{mysql['client']['basedir']}\\bin"
|
44
|
+
default['mysql']['client']['ruby_dir'] = RbConfig::CONFIG['bindir']
|
45
|
+
when "mac_os_x"
|
46
|
+
default['mysql']['client']['packages'] = %w{mysql-connector-c}
|
47
|
+
else
|
48
|
+
default['mysql']['client']['packages'] = %w{mysql-client libmysqlclient-dev}
|
49
|
+
end
|
50
|
+
|
@@ -0,0 +1,240 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: mysql
|
3
|
+
# Attributes:: server
|
4
|
+
#
|
5
|
+
# Copyright 2008-2009, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
default['mysql']['bind_address'] = attribute?('cloud') ? cloud['local_ipv4'] : ipaddress
|
21
|
+
default['mysql']['port'] = 3306
|
22
|
+
default['mysql']['nice'] = 0
|
23
|
+
|
24
|
+
case node["platform_family"]
|
25
|
+
when "debian"
|
26
|
+
default['mysql']['server']['packages'] = %w{mysql-server}
|
27
|
+
default['mysql']['service_name'] = "mysql"
|
28
|
+
default['mysql']['basedir'] = "/usr"
|
29
|
+
default['mysql']['data_dir'] = "/var/lib/mysql"
|
30
|
+
default['mysql']['root_group'] = "root"
|
31
|
+
default['mysql']['mysqladmin_bin'] = "/usr/bin/mysqladmin"
|
32
|
+
default['mysql']['mysql_bin'] = "/usr/bin/mysql"
|
33
|
+
|
34
|
+
default['mysql']['conf_dir'] = '/etc/mysql'
|
35
|
+
default['mysql']['confd_dir'] = '/etc/mysql/conf.d'
|
36
|
+
default['mysql']['socket'] = "/var/run/mysqld/mysqld.sock"
|
37
|
+
default['mysql']['pid_file'] = "/var/run/mysqld/mysqld.pid"
|
38
|
+
default['mysql']['old_passwords'] = 0
|
39
|
+
default['mysql']['grants_path'] = "/etc/mysql/grants.sql"
|
40
|
+
when "rhel", "fedora", "suse"
|
41
|
+
if node["mysql"]["version"].to_f >= 5.5
|
42
|
+
default['mysql']['service_name'] = "mysql"
|
43
|
+
default['mysql']['pid_file'] = "/var/run/mysql/mysql.pid"
|
44
|
+
else
|
45
|
+
default['mysql']['service_name'] = "mysqld"
|
46
|
+
default['mysql']['pid_file'] = "/var/run/mysqld/mysqld.pid"
|
47
|
+
end
|
48
|
+
default['mysql']['server']['packages'] = %w{mysql-server}
|
49
|
+
default['mysql']['basedir'] = "/usr"
|
50
|
+
default['mysql']['data_dir'] = "/var/lib/mysql"
|
51
|
+
default['mysql']['root_group'] = "root"
|
52
|
+
default['mysql']['mysqladmin_bin'] = "/usr/bin/mysqladmin"
|
53
|
+
default['mysql']['mysql_bin'] = "/usr/bin/mysql"
|
54
|
+
|
55
|
+
default['mysql']['conf_dir'] = '/etc'
|
56
|
+
default['mysql']['confd_dir'] = '/etc/mysql/conf.d'
|
57
|
+
default['mysql']['socket'] = "/var/lib/mysql/mysql.sock"
|
58
|
+
default['mysql']['old_passwords'] = 1
|
59
|
+
default['mysql']['grants_path'] = "/etc/mysql_grants.sql"
|
60
|
+
# RHEL/CentOS mysql package does not support this option.
|
61
|
+
default['mysql']['tunable']['innodb_adaptive_flushing'] = false
|
62
|
+
when "freebsd"
|
63
|
+
default['mysql']['server']['packages'] = %w{mysql55-server}
|
64
|
+
default['mysql']['service_name'] = "mysql-server"
|
65
|
+
default['mysql']['basedir'] = "/usr/local"
|
66
|
+
default['mysql']['data_dir'] = "/var/db/mysql"
|
67
|
+
default['mysql']['root_group'] = "wheel"
|
68
|
+
default['mysql']['mysqladmin_bin'] = "/usr/local/bin/mysqladmin"
|
69
|
+
default['mysql']['mysql_bin'] = "/usr/local/bin/mysql"
|
70
|
+
|
71
|
+
default['mysql']['conf_dir'] = '/usr/local/etc'
|
72
|
+
default['mysql']['confd_dir'] = '/usr/local/etc/mysql/conf.d'
|
73
|
+
default['mysql']['socket'] = "/tmp/mysqld.sock"
|
74
|
+
default['mysql']['pid_file'] = "/var/run/mysqld/mysqld.pid"
|
75
|
+
default['mysql']['old_passwords'] = 0
|
76
|
+
default['mysql']['grants_path'] = "/var/db/mysql/grants.sql"
|
77
|
+
when "windows"
|
78
|
+
default['mysql']['server']['packages'] = ["MySQL Server 5.5"]
|
79
|
+
default['mysql']['version'] = '5.5.21'
|
80
|
+
default['mysql']['arch'] = 'win32'
|
81
|
+
default['mysql']['package_file'] = "mysql-#{mysql['version']}-#{mysql['arch']}.msi"
|
82
|
+
default['mysql']['url'] = "http://www.mysql.com/get/Downloads/MySQL-5.5/#{mysql['package_file']}/from/http://mysql.mirrors.pair.com/"
|
83
|
+
|
84
|
+
default['mysql']['service_name'] = "mysql"
|
85
|
+
default['mysql']['basedir'] = "#{ENV['SYSTEMDRIVE']}\\Program Files (x86)\\MySQL\\#{mysql['server']['packages'].first}"
|
86
|
+
default['mysql']['data_dir'] = "#{node['mysql']['basedir']}\\Data"
|
87
|
+
default['mysql']['bin_dir'] = "#{node['mysql']['basedir']}\\bin"
|
88
|
+
default['mysql']['mysqladmin_bin'] = "#{node['mysql']['bin_dir']}\\mysqladmin"
|
89
|
+
default['mysql']['mysql_bin'] = "#{node['mysql']['bin_dir']}\\mysql"
|
90
|
+
|
91
|
+
default['mysql']['conf_dir'] = node['mysql']['basedir']
|
92
|
+
default['mysql']['old_passwords'] = 0
|
93
|
+
default['mysql']['grants_path'] = "#{node['mysql']['conf_dir']}\\grants.sql"
|
94
|
+
when "mac_os_x"
|
95
|
+
default['mysql']['server']['packages'] = %w{mysql}
|
96
|
+
default['mysql']['basedir'] = "/usr/local/Cellar"
|
97
|
+
default['mysql']['data_dir'] = "/usr/local/var/mysql"
|
98
|
+
default['mysql']['root_group'] = "admin"
|
99
|
+
default['mysql']['mysqladmin_bin'] = "/usr/local/bin/mysqladmin"
|
100
|
+
default['mysql']['mysql_bin'] = "/usr/local/bin/mysql"
|
101
|
+
else
|
102
|
+
default['mysql']['server']['packages'] = %w{mysql-server}
|
103
|
+
default['mysql']['service_name'] = "mysql"
|
104
|
+
default['mysql']['basedir'] = "/usr"
|
105
|
+
default['mysql']['data_dir'] = "/var/lib/mysql"
|
106
|
+
default['mysql']['root_group'] = "root"
|
107
|
+
default['mysql']['mysqladmin_bin'] = "/usr/bin/mysqladmin"
|
108
|
+
default['mysql']['mysql_bin'] = "/usr/bin/mysql"
|
109
|
+
|
110
|
+
default['mysql']['conf_dir'] = '/etc/mysql'
|
111
|
+
default['mysql']['confd_dir'] = '/etc/mysql/conf.d'
|
112
|
+
default['mysql']['socket'] = "/var/run/mysqld/mysqld.sock"
|
113
|
+
default['mysql']['pid_file'] = "/var/run/mysqld/mysqld.pid"
|
114
|
+
default['mysql']['old_passwords'] = 0
|
115
|
+
default['mysql']['grants_path'] = "/etc/mysql/grants.sql"
|
116
|
+
end
|
117
|
+
|
118
|
+
if attribute?('ec2')
|
119
|
+
default['mysql']['ec2_path'] = "/mnt/mysql"
|
120
|
+
default['mysql']['ebs_vol_dev'] = "/dev/sdi"
|
121
|
+
default['mysql']['ebs_vol_size'] = 50
|
122
|
+
end
|
123
|
+
|
124
|
+
default['mysql']['reload_action'] = "restart" # or "reload" or "none"
|
125
|
+
|
126
|
+
default['mysql']['use_upstart'] = node['platform'] == "ubuntu" && node['platform_version'].to_f >= 10.04
|
127
|
+
|
128
|
+
default['mysql']['auto-increment-increment'] = 1
|
129
|
+
default['mysql']['auto-increment-offset'] = 1
|
130
|
+
|
131
|
+
default['mysql']['allow_remote_root'] = false
|
132
|
+
default['mysql']['tunable']['character-set-server'] = "utf8"
|
133
|
+
default['mysql']['tunable']['collation-server'] = "utf8_general_ci"
|
134
|
+
default['mysql']['tunable']['back_log'] = "128"
|
135
|
+
default['mysql']['tunable']['key_buffer'] = "256M"
|
136
|
+
default['mysql']['tunable']['myisam_sort_buffer_size'] = "8M"
|
137
|
+
default['mysql']['tunable']['myisam_max_sort_file_size'] = "2147483648"
|
138
|
+
default['mysql']['tunable']['myisam_repair_threads'] = "1"
|
139
|
+
default['mysql']['tunable']['myisam_recover'] = "BACKUP"
|
140
|
+
default['mysql']['tunable']['max_allowed_packet'] = "16M"
|
141
|
+
default['mysql']['tunable']['max_connections'] = "800"
|
142
|
+
default['mysql']['tunable']['max_connect_errors'] = "10"
|
143
|
+
default['mysql']['tunable']['concurrent_insert'] = "2"
|
144
|
+
default['mysql']['tunable']['connect_timeout'] = "10"
|
145
|
+
default['mysql']['tunable']['tmp_table_size'] = "32M"
|
146
|
+
default['mysql']['tunable']['max_heap_table_size'] = node['mysql']['tunable']['tmp_table_size']
|
147
|
+
default['mysql']['tunable']['bulk_insert_buffer_size'] = node['mysql']['tunable']['tmp_table_size']
|
148
|
+
default['mysql']['tunable']['myisam_recover'] = "BACKUP"
|
149
|
+
default['mysql']['tunable']['net_read_timeout'] = "30"
|
150
|
+
default['mysql']['tunable']['net_write_timeout'] = "30"
|
151
|
+
default['mysql']['tunable']['table_cache'] = "128"
|
152
|
+
|
153
|
+
default['mysql']['tunable']['thread_cache'] = "128"
|
154
|
+
default['mysql']['tunable']['thread_cache_size'] = 8
|
155
|
+
default['mysql']['tunable']['thread_concurrency'] = 10
|
156
|
+
default['mysql']['tunable']['thread_stack'] = "256K"
|
157
|
+
default['mysql']['tunable']['sort_buffer_size'] = "2M"
|
158
|
+
default['mysql']['tunable']['read_buffer_size'] = "128k"
|
159
|
+
default['mysql']['tunable']['read_rnd_buffer_size'] = "256k"
|
160
|
+
default['mysql']['tunable']['join_buffer_size'] = "128k"
|
161
|
+
default['mysql']['tunable']['wait_timeout'] = "180"
|
162
|
+
default['mysql']['tunable']['open-files-limit'] = "8192"
|
163
|
+
default['mysql']['tunable']['open-files'] = "1024"
|
164
|
+
|
165
|
+
default['mysql']['tunable']['sql_mode'] = nil
|
166
|
+
|
167
|
+
default['mysql']['tunable']['skip-character-set-client-handshake'] = false
|
168
|
+
default['mysql']['tunable']['skip-name-resolve'] = false
|
169
|
+
|
170
|
+
|
171
|
+
default['mysql']['tunable']['server_id'] = nil
|
172
|
+
default['mysql']['tunable']['log_bin'] = nil
|
173
|
+
default['mysql']['tunable']['log_bin_trust_function_creators'] = false
|
174
|
+
|
175
|
+
default['mysql']['tunable']['relay_log'] = nil
|
176
|
+
default['mysql']['tunable']['relay_log_index'] = nil
|
177
|
+
default['mysql']['tunable']['log_slave_updates'] = false
|
178
|
+
|
179
|
+
default['mysql']['tunable']['sync_binlog'] = 0
|
180
|
+
default['mysql']['tunable']['skip_slave_start'] = false
|
181
|
+
default['mysql']['tunable']['read_only'] = false
|
182
|
+
|
183
|
+
default['mysql']['tunable']['log_error'] = nil
|
184
|
+
default['mysql']['tunable']['log_warnings'] = false
|
185
|
+
default['mysql']['tunable']['log_queries_not_using_index'] = true
|
186
|
+
default['mysql']['tunable']['log_bin_trust_function_creators'] = false
|
187
|
+
|
188
|
+
default['mysql']['tunable']['innodb_log_file_size'] = "5M"
|
189
|
+
default['mysql']['tunable']['innodb_buffer_pool_size'] = "128M"
|
190
|
+
default['mysql']['tunable']['innodb_buffer_pool_instances'] = "4"
|
191
|
+
default['mysql']['tunable']['innodb_additional_mem_pool_size'] = "8M"
|
192
|
+
default['mysql']['tunable']['innodb_data_file_path'] = "ibdata1:10M:autoextend"
|
193
|
+
default['mysql']['tunable']['innodb_flush_method'] = false
|
194
|
+
default['mysql']['tunable']['innodb_log_buffer_size'] = "8M"
|
195
|
+
default['mysql']['tunable']['innodb_write_io_threads'] = "4"
|
196
|
+
default['mysql']['tunable']['innodb_io_capacity'] = "200"
|
197
|
+
default['mysql']['tunable']['innodb_file_per_table'] = true
|
198
|
+
default['mysql']['tunable']['innodb_lock_wait_timeout'] = "60"
|
199
|
+
if node['cpu'].nil? or node['cpu']['total'].nil?
|
200
|
+
default['mysql']['tunable']['innodb_thread_concurrency'] = "8"
|
201
|
+
default['mysql']['tunable']['innodb_commit_concurrency'] = "8"
|
202
|
+
default['mysql']['tunable']['innodb_read_io_threads'] = "8"
|
203
|
+
default['mysql']['tunable']['innodb_flush_log_at_trx_commit'] = "8"
|
204
|
+
else
|
205
|
+
default['mysql']['tunable']['innodb_thread_concurrency'] = "#{(Integer(node['cpu']['total'])) * 2}"
|
206
|
+
default['mysql']['tunable']['innodb_commit_concurrency'] = "#{(Integer(node['cpu']['total'])) * 2}"
|
207
|
+
default['mysql']['tunable']['innodb_read_io_threads'] = "#{(Integer(node['cpu']['total'])) * 2}"
|
208
|
+
default['mysql']['tunable']['innodb_flush_log_at_trx_commit'] = "#{(Integer(node['cpu']['total'])) * 2}"
|
209
|
+
end
|
210
|
+
default['mysql']['tunable']['innodb_support_xa'] = true
|
211
|
+
default['mysql']['tunable']['innodb_table_locks'] = true
|
212
|
+
default['mysql']['tunable']['skip-innodb-doublewrite'] = false
|
213
|
+
|
214
|
+
default['mysql']['tunable']['transaction-isolation'] = nil
|
215
|
+
|
216
|
+
default['mysql']['tunable']['query_cache_limit'] = "1M"
|
217
|
+
default['mysql']['tunable']['query_cache_size'] = "16M"
|
218
|
+
|
219
|
+
default['mysql']['tunable']['log_slow_queries'] = "/var/log/mysql/slow.log"
|
220
|
+
default['mysql']['tunable']['slow_query_log'] = node['mysql']['tunable']['log_slow_queries'] # log_slow_queries is deprecated
|
221
|
+
# in favor of slow_query_log
|
222
|
+
default['mysql']['tunable']['long_query_time'] = 2
|
223
|
+
|
224
|
+
default['mysql']['tunable']['expire_logs_days'] = 10
|
225
|
+
default['mysql']['tunable']['max_binlog_size'] = "100M"
|
226
|
+
default['mysql']['tunable']['binlog_cache_size'] = "32K"
|
227
|
+
|
228
|
+
default['mysql']['tmpdir'] = ["/tmp"]
|
229
|
+
default['mysql']['read_only'] = false
|
230
|
+
|
231
|
+
default['mysql']['log_dir'] = node['mysql']['data_dir']
|
232
|
+
default['mysql']['log_files_in_group'] = false
|
233
|
+
default['mysql']['innodb_status_file'] = false
|
234
|
+
|
235
|
+
unless node['platform_family'] && node['platform_version'].to_i < 6
|
236
|
+
# older RHEL platforms don't support these options
|
237
|
+
default['mysql']['tunable']['event_scheduler'] = 0
|
238
|
+
default['mysql']['tunable']['table_open_cache'] = "128"
|
239
|
+
default['mysql']['tunable']['binlog_format'] = "statement" if node['mysql']['tunable']['log_bin']
|
240
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.expand_path('../support/helpers.rb', __FILE__)
|
2
|
+
|
3
|
+
describe 'mysql::server' do
|
4
|
+
|
5
|
+
include Helpers::Mysql
|
6
|
+
|
7
|
+
it 'has a secure operating system password' do
|
8
|
+
assert_secure_password(:debian)
|
9
|
+
end
|
10
|
+
it 'has a secure root password' do
|
11
|
+
assert_secure_password(:root)
|
12
|
+
end
|
13
|
+
it 'has a secure replication password' do
|
14
|
+
assert_secure_password(:repl)
|
15
|
+
end
|
16
|
+
it 'installs the mysql packages' do
|
17
|
+
node['mysql']['server']['packages'].each do |package_name|
|
18
|
+
package(package_name).must_be_installed
|
19
|
+
end
|
20
|
+
end
|
21
|
+
it 'has a config directory' do
|
22
|
+
directory(node['mysql']['confd_dir']).must_exist.with(:owner, 'mysql').and(:group, 'mysql')
|
23
|
+
end
|
24
|
+
it 'runs as a daemon' do
|
25
|
+
service(node['mysql']['service_name']).must_be_running
|
26
|
+
end
|
27
|
+
it 'creates a my.cnf' do
|
28
|
+
file("#{node['mysql']['conf_dir']}/my.cnf").must_exist
|
29
|
+
end
|
30
|
+
describe 'debian' do
|
31
|
+
it 'creates a config file for service control' do
|
32
|
+
skip unless ['debian'].include?(node['platform_family'])
|
33
|
+
file("#{node['mysql']['conf_dir']}/debian.cnf").must_exist
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Helpers
|
2
|
+
module Mysql
|
3
|
+
include MiniTest::Chef::Assertions
|
4
|
+
include MiniTest::Chef::Context
|
5
|
+
include MiniTest::Chef::Resources
|
6
|
+
|
7
|
+
def assert_secure_password(type)
|
8
|
+
node["mysql"]["server_#{type}_password"].length.must_be_close_to(20, 8)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Seth Chisamore (<schisamo@opscode.com>)
|
3
|
+
# Copyright:: Copyright (c) 2011 Opscode, Inc.
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
module Opscode
|
20
|
+
module Mysql
|
21
|
+
module Helpers
|
22
|
+
|
23
|
+
def debian_before_squeeze?
|
24
|
+
(node['platform'] == "debian") && (node['platform_version'].to_f < 6.0)
|
25
|
+
end
|
26
|
+
|
27
|
+
def ubuntu_before_lucid?
|
28
|
+
(node['platform'] == "ubuntu") && (node['platform_version'].to_f < 10.0)
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|