freighthop 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Puppetfile +1 -0
- data/Puppetfile.lock +3 -0
- data/Vagrantfile +1 -1
- data/bin/fh +2 -78
- data/lib/freighthop/cli/help.rb +69 -0
- data/lib/freighthop/cli/ssh.rb +46 -0
- data/lib/freighthop/cli/vagrant.rb +26 -0
- data/lib/freighthop/cli.rb +40 -0
- data/lib/freighthop/config.rb +4 -0
- data/lib/freighthop/vagrant_env.rb +24 -0
- data/lib/freighthop/version.rb +1 -1
- data/lib/freighthop.rb +7 -4
- data/local_modules/freighthop/manifests/database/mysql.pp +20 -0
- data/local_modules/freighthop/manifests/database/postgres.pp +6 -6
- data/local_modules/freighthop/manifests/database.pp +6 -8
- data/local_modules/freighthop/manifests/init.pp +1 -8
- data/local_modules/freighthop/manifests/params.pp +0 -3
- data/modules/apt/CHANGELOG +12 -2
- data/modules/apt/Gemfile +6 -5
- data/modules/apt/Gemfile.lock +40 -5
- data/modules/apt/Modulefile +1 -1
- data/modules/apt/README.md +2 -1
- data/modules/apt/Rakefile +1 -0
- data/modules/apt/manifests/init.pp +4 -1
- data/modules/apt/manifests/ppa.pp +1 -1
- data/modules/apt/manifests/update.pp +1 -0
- data/modules/apt/metadata.json +21 -13
- data/modules/apt/spec/defines/ppa_spec.rb +3 -3
- data/modules/apt/spec/defines/source_spec.rb +2 -2
- data/modules/apt/spec/spec_helper_system.rb +30 -0
- data/modules/apt/spec/system/apt_builddep_spec.rb +38 -0
- data/modules/apt/spec/system/apt_key_spec.rb +53 -0
- data/modules/apt/spec/system/apt_ppa_spec.rb +59 -0
- data/modules/apt/spec/system/apt_source_spec.rb +51 -0
- data/modules/apt/spec/system/basic_spec.rb +10 -0
- data/modules/apt/spec/system/class_spec.rb +20 -0
- data/modules/apt/templates/source.list.erb +2 -2
- data/modules/freighthop/manifests/database/mysql.pp +20 -0
- data/modules/freighthop/manifests/database/postgres.pp +6 -6
- data/modules/freighthop/manifests/database.pp +6 -8
- data/modules/freighthop/manifests/init.pp +1 -8
- data/modules/freighthop/manifests/params.pp +0 -3
- data/modules/mysql/CHANGELOG +403 -0
- data/modules/mysql/Gemfile +24 -0
- data/modules/mysql/Gemfile.lock +129 -0
- data/modules/mysql/LICENSE +201 -0
- data/modules/mysql/Modulefile +9 -0
- data/modules/mysql/README.md +492 -0
- data/modules/mysql/Rakefile +2 -0
- data/modules/mysql/TODO +8 -0
- data/modules/mysql/files/mysqltuner.pl +966 -0
- data/modules/mysql/lib/puppet/parser/functions/mysql_deepmerge.rb +52 -0
- data/modules/mysql/lib/puppet/parser/functions/mysql_password.rb +15 -0
- data/modules/mysql/lib/puppet/parser/functions/mysql_strip_hash.rb +21 -0
- data/modules/mysql/lib/puppet/provider/database/mysql.rb +52 -0
- data/modules/mysql/lib/puppet/provider/database_grant/mysql.rb +210 -0
- data/modules/mysql/lib/puppet/provider/database_user/mysql.rb +76 -0
- data/modules/mysql/lib/puppet/provider/mysql.rb +67 -0
- data/modules/mysql/lib/puppet/provider/mysql_database/mysql.rb +68 -0
- data/modules/mysql/lib/puppet/provider/mysql_grant/mysql.rb +115 -0
- data/modules/mysql/lib/puppet/provider/mysql_user/mysql.rb +115 -0
- data/modules/mysql/lib/puppet/type/database.rb +21 -0
- data/modules/mysql/lib/puppet/type/database_grant.rb +79 -0
- data/modules/mysql/lib/puppet/type/database_user.rb +31 -0
- data/modules/mysql/lib/puppet/type/mysql_database.rb +22 -0
- data/modules/mysql/lib/puppet/type/mysql_grant.rb +72 -0
- data/modules/mysql/lib/puppet/type/mysql_user.rb +45 -0
- data/modules/mysql/manifests/backup.pp +31 -0
- data/modules/mysql/manifests/bindings/java.pp +10 -0
- data/modules/mysql/manifests/bindings/perl.pp +10 -0
- data/modules/mysql/manifests/bindings/php.pp +10 -0
- data/modules/mysql/manifests/bindings/python.pp +10 -0
- data/modules/mysql/manifests/bindings/ruby.pp +10 -0
- data/modules/mysql/manifests/bindings.pp +33 -0
- data/modules/mysql/manifests/client/install.pp +8 -0
- data/modules/mysql/manifests/client.pp +27 -0
- data/modules/mysql/manifests/db.pp +59 -0
- data/modules/mysql/manifests/init.pp +100 -0
- data/modules/mysql/manifests/params.pp +230 -0
- data/modules/mysql/manifests/server/account_security.pp +22 -0
- data/modules/mysql/manifests/server/backup.pp +56 -0
- data/modules/mysql/manifests/server/config.pp +31 -0
- data/modules/mysql/manifests/server/install.pp +9 -0
- data/modules/mysql/manifests/server/monitor.pp +24 -0
- data/modules/mysql/manifests/server/mysqltuner.pp +9 -0
- data/modules/mysql/manifests/server/providers.pp +8 -0
- data/modules/mysql/manifests/server/root_password.pp +21 -0
- data/modules/mysql/manifests/server/service.pp +19 -0
- data/modules/mysql/manifests/server.pp +69 -0
- data/modules/mysql/metadata.json +289 -0
- data/modules/mysql/spec/classes/mysql_bindings_spec.rb +58 -0
- data/modules/mysql/spec/classes/mysql_client_spec.rb +16 -0
- data/modules/mysql/spec/classes/mysql_server_account_security_spec.rb +41 -0
- data/modules/mysql/spec/classes/mysql_server_backup_spec.rb +112 -0
- data/modules/mysql/spec/classes/mysql_server_monitor_spec.rb +31 -0
- data/modules/mysql/spec/classes/mysql_server_mysqltuner_spec.rb +5 -0
- data/modules/mysql/spec/classes/mysql_server_spec.rb +162 -0
- data/modules/mysql/spec/defines/mysql_db_spec.rb +51 -0
- data/modules/mysql/spec/spec.opts +6 -0
- data/modules/mysql/spec/spec_helper.rb +5 -0
- data/modules/mysql/spec/spec_helper_system.rb +28 -0
- data/modules/mysql/spec/system/mysql_account_delete_spec.rb +35 -0
- data/modules/mysql/spec/system/mysql_backup_spec.rb +77 -0
- data/modules/mysql/spec/system/mysql_bindings_spec.rb +90 -0
- data/modules/mysql/spec/system/mysql_db_spec.rb +61 -0
- data/modules/mysql/spec/system/mysql_server_monitor_spec.rb +30 -0
- data/modules/mysql/spec/system/mysql_server_root_password_spec.rb +71 -0
- data/modules/mysql/spec/system/mysql_server_spec.rb +85 -0
- data/modules/mysql/spec/system/types/mysql_grant_spec.rb +314 -0
- data/modules/mysql/spec/system/types/mysql_user_spec.rb +35 -0
- data/modules/mysql/spec/unit/mysql_password_spec.rb +27 -0
- data/modules/mysql/spec/unit/puppet/functions/mysql_deepmerge_spec.rb +77 -0
- data/modules/mysql/spec/unit/puppet/provider/database/mysql_spec.rb +86 -0
- data/modules/mysql/spec/unit/puppet/provider/database_grant/mysql_spec.rb +95 -0
- data/modules/mysql/spec/unit/puppet/provider/database_user/mysql_spec.rb +119 -0
- data/modules/mysql/spec/unit/puppet/provider/mysql_database/mysql_spec.rb +118 -0
- data/modules/mysql/spec/unit/puppet/provider/mysql_user/mysql_spec.rb +130 -0
- data/modules/mysql/spec/unit/puppet/type/mysql_database_spec.rb +29 -0
- data/modules/mysql/spec/unit/puppet/type/mysql_user_spec.rb +30 -0
- data/modules/mysql/templates/my.cnf.erb +17 -0
- data/modules/mysql/templates/my.cnf.pass.erb +7 -0
- data/modules/mysql/templates/my.conf.cnf.erb +17 -0
- data/modules/mysql/templates/mysqlbackup.sh.erb +57 -0
- data/modules/mysql/tests/backup.pp +8 -0
- data/modules/mysql/tests/bindings.pp +3 -0
- data/modules/mysql/tests/init.pp +1 -0
- data/modules/mysql/tests/java.pp +1 -0
- data/modules/mysql/tests/mysql_database.pp +12 -0
- data/modules/mysql/tests/mysql_grant.pp +5 -0
- data/modules/mysql/tests/mysql_user.pp +23 -0
- data/modules/mysql/tests/perl.pp +1 -0
- data/modules/mysql/tests/python.pp +1 -0
- data/modules/mysql/tests/ruby.pp +1 -0
- data/modules/mysql/tests/server/account_security.pp +4 -0
- data/modules/mysql/tests/server/config.pp +11 -0
- data/modules/mysql/tests/server.pp +3 -0
- data/modules/postgresql/Changelog +191 -0
- data/modules/postgresql/Gemfile +1 -0
- data/modules/postgresql/Gemfile.lock +9 -0
- data/modules/postgresql/LICENSE +198 -12
- data/modules/postgresql/Modulefile +2 -2
- data/modules/postgresql/NOTICE +14 -0
- data/modules/postgresql/README.md +435 -184
- data/modules/postgresql/files/validate_postgresql_connection.sh +31 -0
- data/modules/postgresql/lib/puppet/provider/postgresql_conf/parsed.rb +37 -0
- data/modules/postgresql/lib/puppet/provider/postgresql_psql/ruby.rb +4 -0
- data/modules/postgresql/lib/puppet/type/postgresql_conf.rb +31 -0
- data/modules/postgresql/lib/puppet/type/postgresql_psql.rb +4 -0
- data/modules/postgresql/manifests/client.pp +17 -16
- data/modules/postgresql/manifests/globals.pp +95 -0
- data/modules/postgresql/manifests/lib/devel.pp +15 -0
- data/modules/postgresql/manifests/lib/java.pp +15 -0
- data/modules/postgresql/manifests/lib/python.pp +13 -0
- data/modules/postgresql/manifests/params.pp +127 -222
- data/modules/postgresql/manifests/repo/apt_postgresql_org.pp +30 -0
- data/modules/postgresql/manifests/repo/yum_postgresql_org.pp +38 -0
- data/modules/postgresql/manifests/repo.pp +22 -0
- data/modules/postgresql/manifests/server/config.pp +113 -0
- data/modules/postgresql/manifests/server/config_entry.pp +43 -0
- data/modules/postgresql/manifests/server/contrib.pp +27 -0
- data/modules/postgresql/manifests/server/database.pp +75 -0
- data/modules/postgresql/manifests/server/database_grant.pp +18 -0
- data/modules/postgresql/manifests/server/db.pp +36 -0
- data/modules/postgresql/manifests/server/firewall.pp +21 -0
- data/modules/postgresql/manifests/server/grant.pp +81 -0
- data/modules/postgresql/manifests/server/initdb.pp +52 -0
- data/modules/postgresql/manifests/server/install.pp +49 -0
- data/modules/postgresql/manifests/server/passwd.pp +34 -0
- data/modules/postgresql/manifests/server/pg_hba_rule.pp +54 -0
- data/modules/postgresql/manifests/server/plperl.pp +27 -0
- data/modules/postgresql/manifests/server/reload.pp +15 -0
- data/modules/postgresql/manifests/{role.pp → server/role.pp} +19 -33
- data/modules/postgresql/manifests/server/service.pp +40 -0
- data/modules/postgresql/manifests/{table_grant.pp → server/table_grant.pp} +4 -4
- data/modules/postgresql/manifests/server/tablespace.pp +42 -0
- data/modules/postgresql/manifests/server.pp +61 -83
- data/modules/postgresql/manifests/validate_db_connection.pp +49 -50
- data/modules/postgresql/metadata.json +123 -73
- data/modules/postgresql/spec/spec_helper_system.rb +13 -1
- data/modules/postgresql/spec/system/client_spec.rb +22 -0
- data/modules/postgresql/spec/system/common_patterns_spec.rb +53 -0
- data/modules/postgresql/spec/system/contrib_spec.rb +33 -0
- data/modules/postgresql/spec/system/lib/devel_spec.rb +22 -0
- data/modules/postgresql/spec/system/lib/java_spec.rb +25 -0
- data/modules/postgresql/spec/system/lib/python_spec.rb +24 -0
- data/modules/postgresql/spec/system/postgresql_psql_spec.rb +51 -0
- data/modules/postgresql/spec/system/server/config_entry_spec.rb +32 -0
- data/modules/postgresql/spec/system/server/database_grant_spec.rb +54 -0
- data/modules/postgresql/spec/system/server/database_spec.rb +35 -0
- data/modules/postgresql/spec/system/server/db_spec.rb +143 -0
- data/modules/postgresql/spec/system/server/grant_spec.rb +55 -0
- data/modules/postgresql/spec/system/server/pg_hba_rule_spec.rb +85 -0
- data/modules/postgresql/spec/system/server/plperl_spec.rb +29 -0
- data/modules/postgresql/spec/system/server/role_spec.rb +103 -0
- data/modules/postgresql/spec/system/server/table_grant_spec.rb +72 -0
- data/modules/postgresql/spec/system/server/tablespace_spec.rb +74 -0
- data/modules/postgresql/spec/system/server_spec.rb +217 -0
- data/modules/postgresql/spec/system/validate_db_connection_spec.rb +91 -0
- data/modules/postgresql/spec/unit/classes/client_spec.rb +27 -2
- data/modules/postgresql/spec/unit/classes/globals_spec.rb +28 -0
- data/modules/postgresql/spec/unit/classes/lib/devel_spec.rb +12 -0
- data/modules/postgresql/spec/unit/classes/{postgresql_java_spec.rb → lib/java_spec.rb} +9 -19
- data/modules/postgresql/spec/unit/classes/lib/python_spec.rb +31 -0
- data/modules/postgresql/spec/unit/classes/params_spec.rb +2 -1
- data/modules/postgresql/spec/unit/classes/repo_spec.rb +17 -0
- data/modules/postgresql/spec/unit/classes/server/contrib_spec.rb +42 -0
- data/modules/postgresql/spec/unit/classes/server/initdb_spec.rb +28 -0
- data/modules/postgresql/spec/unit/classes/server/plperl_spec.rb +45 -0
- data/modules/postgresql/spec/unit/classes/server_spec.rb +83 -2
- data/modules/postgresql/spec/unit/defines/server/config_entry_spec.rb +23 -0
- data/modules/postgresql/spec/unit/defines/server/database_grant_spec.rb +26 -0
- data/modules/postgresql/spec/unit/defines/server/database_spec.rb +16 -0
- data/modules/postgresql/spec/unit/defines/server/db_spec.rb +28 -0
- data/modules/postgresql/spec/unit/defines/{database_grant_spec.rb → server/grant_spec.rb} +7 -4
- data/modules/postgresql/spec/unit/defines/{pg_hba_rule_spec.rb → server/pg_hba_rule_spec.rb} +59 -2
- data/modules/postgresql/spec/unit/defines/server/role_spec.rb +23 -0
- data/modules/postgresql/spec/unit/defines/server/table_grant_spec.rb +27 -0
- data/modules/postgresql/spec/unit/defines/server/tablespace_spec.rb +23 -0
- data/modules/postgresql/spec/unit/defines/validate_db_connection_spec.rb +22 -9
- data/modules/postgresql/spec/unit/provider/postgresql_conf/parsed_spec.rb +112 -0
- data/modules/postgresql/spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb +29 -0
- data/modules/postgresql/spec/unit/puppet/type/postgresql_psql_spec.rb +1 -0
- data/modules/postgresql/spec/unit/type/postgresql_conf_spec.rb +50 -0
- metadata +177 -53
- data/modules/postgresql/examples/init.pp +0 -1
- data/modules/postgresql/examples/official-postgresql-repos.pp +0 -19
- data/modules/postgresql/examples/postgresql_database.pp +0 -22
- data/modules/postgresql/examples/postgresql_db.pp +0 -30
- data/modules/postgresql/examples/postgresql_grant.pp +0 -14
- data/modules/postgresql/examples/postgresql_pg_hba_rule.pp +0 -18
- data/modules/postgresql/examples/postgresql_pgconf_extras.pp +0 -19
- data/modules/postgresql/examples/postgresql_tablespace.pp +0 -73
- data/modules/postgresql/examples/postgresql_user.pp +0 -28
- data/modules/postgresql/examples/server.pp +0 -10
- data/modules/postgresql/lib/facter/postgres_default_version.rb +0 -69
- data/modules/postgresql/manifests/config/afterservice.pp +0 -47
- data/modules/postgresql/manifests/config/beforeservice.pp +0 -171
- data/modules/postgresql/manifests/config.pp +0 -74
- data/modules/postgresql/manifests/contrib.pp +0 -29
- data/modules/postgresql/manifests/database.pp +0 -85
- data/modules/postgresql/manifests/database_grant.pp +0 -35
- data/modules/postgresql/manifests/database_user.pp +0 -60
- data/modules/postgresql/manifests/db.pp +0 -77
- data/modules/postgresql/manifests/devel.pp +0 -27
- data/modules/postgresql/manifests/grant.pp +0 -77
- data/modules/postgresql/manifests/init.pp +0 -145
- data/modules/postgresql/manifests/initdb.pp +0 -52
- data/modules/postgresql/manifests/java.pp +0 -29
- data/modules/postgresql/manifests/package_source/apt_postgresql_org.pp +0 -21
- data/modules/postgresql/manifests/package_source/yum_postgresql_org.pp +0 -30
- data/modules/postgresql/manifests/pg_hba.pp +0 -19
- data/modules/postgresql/manifests/pg_hba_rule.pp +0 -41
- data/modules/postgresql/manifests/plperl.pp +0 -24
- data/modules/postgresql/manifests/psql.pp +0 -56
- data/modules/postgresql/manifests/python.pp +0 -18
- data/modules/postgresql/manifests/tablespace.pp +0 -59
- data/modules/postgresql/spec/system/install_spec.rb +0 -707
- data/modules/postgresql/spec/system/non_defaults_spec.rb +0 -114
- data/modules/postgresql/spec/unit/classes/contrib_spec.rb +0 -11
- data/modules/postgresql/spec/unit/classes/devel_spec.rb +0 -11
- data/modules/postgresql/spec/unit/classes/init_spec.rb +0 -71
- data/modules/postgresql/spec/unit/classes/postgresql_python_spec.rb +0 -53
- data/modules/postgresql/spec/unit/defines/database_spec.rb +0 -14
- data/modules/postgresql/spec/unit/defines/database_user_spec.rb +0 -19
- data/modules/postgresql/spec/unit/defines/db_spec.rb +0 -20
- data/modules/postgresql/spec/unit/defines/pg_hba_spec.rb +0 -20
- data/modules/postgresql/spec/unit/defines/psql_spec.rb +0 -20
- data/modules/postgresql/spec/unit/defines/role_spec.rb +0 -14
- data/modules/postgresql/spec/unit/defines/tablespace_spec.rb +0 -19
- data/modules/postgresql/spec/unit/facts/postgres_default_version_spec.rb +0 -14
@@ -0,0 +1,289 @@
|
|
1
|
+
{
|
2
|
+
"name": "puppetlabs-mysql",
|
3
|
+
"version": "2.1.0",
|
4
|
+
"summary": "Mysql module",
|
5
|
+
"author": "Puppet Labs",
|
6
|
+
"description": "Mysql module",
|
7
|
+
"dependencies": [
|
8
|
+
{
|
9
|
+
"name": "puppetlabs/stdlib",
|
10
|
+
"version_requirement": "\u003e\u003d 2.2.1"
|
11
|
+
}
|
12
|
+
],
|
13
|
+
"types": [
|
14
|
+
{
|
15
|
+
"properties": [
|
16
|
+
{
|
17
|
+
"name": "password_hash",
|
18
|
+
"doc": "The password hash of the user. Use mysql_password() for creating such a hash."
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"name": "max_user_connections",
|
22
|
+
"doc": "Max concurrent connections for the user. 0 means no (or global) limit."
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"parameters": [
|
26
|
+
{
|
27
|
+
"name": "name",
|
28
|
+
"doc": "The name of the user. This uses the \u0027username@hostname\u0027 or username@hostname."
|
29
|
+
}
|
30
|
+
],
|
31
|
+
"providers": [
|
32
|
+
{
|
33
|
+
"name": "mysql",
|
34
|
+
"doc": "manage users for a mysql database."
|
35
|
+
}
|
36
|
+
],
|
37
|
+
"name": "database_user",
|
38
|
+
"doc": "Manage a database user. This includes management of users password as well as privileges"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"properties": [
|
42
|
+
{
|
43
|
+
"name": "charset",
|
44
|
+
"doc": "The CHARACTER SET setting for the database"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"name": "collate",
|
48
|
+
"doc": "The COLLATE setting for the database"
|
49
|
+
}
|
50
|
+
],
|
51
|
+
"parameters": [
|
52
|
+
{
|
53
|
+
"name": "name",
|
54
|
+
"doc": "The name of the MySQL database to manage."
|
55
|
+
}
|
56
|
+
],
|
57
|
+
"providers": [
|
58
|
+
{
|
59
|
+
"name": "mysql",
|
60
|
+
"doc": "Manages MySQL databases."
|
61
|
+
}
|
62
|
+
],
|
63
|
+
"name": "mysql_database",
|
64
|
+
"doc": "Manage MySQL databases."
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"properties": [
|
68
|
+
{
|
69
|
+
"name": "password_hash",
|
70
|
+
"doc": "The password hash of the user. Use mysql_password() for creating such a hash."
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"name": "max_user_connections",
|
74
|
+
"doc": "Max concurrent connections for the user. 0 means no (or global) limit."
|
75
|
+
},
|
76
|
+
{
|
77
|
+
"name": "max_connections_per_hour",
|
78
|
+
"doc": "Max connections per hour for the user. 0 means no (or global) limit."
|
79
|
+
},
|
80
|
+
{
|
81
|
+
"name": "max_queries_per_hour",
|
82
|
+
"doc": "Max queries per hour for the user. 0 means no (or global) limit."
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"name": "max_updates_per_hour",
|
86
|
+
"doc": "Max updates per hour for the user. 0 means no (or global) limit."
|
87
|
+
}
|
88
|
+
],
|
89
|
+
"parameters": [
|
90
|
+
{
|
91
|
+
"name": "name",
|
92
|
+
"doc": "The name of the user. This uses the \u0027username@hostname\u0027 or username@hostname."
|
93
|
+
}
|
94
|
+
],
|
95
|
+
"providers": [
|
96
|
+
{
|
97
|
+
"name": "mysql",
|
98
|
+
"doc": "manage users for a mysql database."
|
99
|
+
}
|
100
|
+
],
|
101
|
+
"name": "mysql_user",
|
102
|
+
"doc": "Manage a MySQL user. This includes management of users password as well as privileges."
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"properties": [
|
106
|
+
{
|
107
|
+
"name": "charset",
|
108
|
+
"doc": "The characterset to use for a database"
|
109
|
+
}
|
110
|
+
],
|
111
|
+
"parameters": [
|
112
|
+
{
|
113
|
+
"name": "name",
|
114
|
+
"doc": "The name of the database."
|
115
|
+
}
|
116
|
+
],
|
117
|
+
"providers": [
|
118
|
+
{
|
119
|
+
"name": "mysql",
|
120
|
+
"doc": "Manages MySQL database."
|
121
|
+
}
|
122
|
+
],
|
123
|
+
"name": "database",
|
124
|
+
"doc": "Manage databases."
|
125
|
+
},
|
126
|
+
{
|
127
|
+
"properties": [
|
128
|
+
{
|
129
|
+
"name": "privileges",
|
130
|
+
"doc": "The privileges the user should have. The possible values are implementation dependent."
|
131
|
+
}
|
132
|
+
],
|
133
|
+
"parameters": [
|
134
|
+
{
|
135
|
+
"name": "name",
|
136
|
+
"doc": "The primary key: either user@host for global privilges or user@host/database for database specific privileges"
|
137
|
+
}
|
138
|
+
],
|
139
|
+
"providers": [
|
140
|
+
{
|
141
|
+
"name": "mysql",
|
142
|
+
"doc": "Uses mysql as database."
|
143
|
+
}
|
144
|
+
],
|
145
|
+
"name": "database_grant",
|
146
|
+
"doc": "Manage a database user\u0027s rights."
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"properties": [
|
150
|
+
{
|
151
|
+
"name": "privileges",
|
152
|
+
"doc": "Privileges for user"
|
153
|
+
},
|
154
|
+
{
|
155
|
+
"name": "table",
|
156
|
+
"doc": "Table to apply privileges to."
|
157
|
+
},
|
158
|
+
{
|
159
|
+
"name": "user",
|
160
|
+
"doc": "User to operate on."
|
161
|
+
},
|
162
|
+
{
|
163
|
+
"name": "options",
|
164
|
+
"doc": "Options to grant."
|
165
|
+
}
|
166
|
+
],
|
167
|
+
"parameters": [
|
168
|
+
{
|
169
|
+
"name": "name",
|
170
|
+
"doc": "Name to describe the grant."
|
171
|
+
}
|
172
|
+
],
|
173
|
+
"providers": [
|
174
|
+
{
|
175
|
+
"name": "mysql",
|
176
|
+
"doc": "Set grants for users in MySQL."
|
177
|
+
}
|
178
|
+
],
|
179
|
+
"name": "mysql_grant",
|
180
|
+
"doc": "Manage a MySQL user\u0027s rights."
|
181
|
+
}
|
182
|
+
],
|
183
|
+
"checksums": {
|
184
|
+
".bundle/config": "7f1c988748783d2a8d455376eed1470c",
|
185
|
+
".fixtures.yml": "754de171830d3a00220cdc85bcb794a0",
|
186
|
+
".forge-release/pom.xml": "c650a84961ad88de03192e23b63b3549",
|
187
|
+
".forge-release/publish": "1c1d6dd64ef52246db485eb5459aa941",
|
188
|
+
".forge-release/settings.xml": "06d768a57d582fe1ee078b563427e750",
|
189
|
+
".forge-release/validate": "7fffde8112f42a1ec986d49ba80ac219",
|
190
|
+
".nodeset.yml": "f2b857f9fc7a701ff118e28591c12925",
|
191
|
+
".travis.yml": "35fe54be03fbc47ce9b015b22240e683",
|
192
|
+
"CHANGELOG": "0955be7c90f16e48ae9749641170ca69",
|
193
|
+
"Gemfile": "4d0813cea67347e0abb409f53f814155",
|
194
|
+
"Gemfile.lock": "9ee04c7900f8209895e1acee1664ce7d",
|
195
|
+
"LICENSE": "6089b6bd1f0d807edb8bdfd76da0b038",
|
196
|
+
"Modulefile": "8faf920c294adde182c9087cf1113db3",
|
197
|
+
"README.md": "9afcf56a8845ec7e06739bb74478929e",
|
198
|
+
"Rakefile": "0428ea3759a4692c91604396c406a9c1",
|
199
|
+
"TODO": "88ca4024a37992b46c34cb46e4ac39e6",
|
200
|
+
"files/mysqltuner.pl": "65056d1386e04fdf22a1fee556c1b9fc",
|
201
|
+
"lib/puppet/parser/functions/mysql_deepmerge.rb": "6f20428e15e98f2368ee63a56412a7c3",
|
202
|
+
"lib/puppet/parser/functions/mysql_password.rb": "a4c8ec72dede069508dbc266131b06a3",
|
203
|
+
"lib/puppet/parser/functions/mysql_strip_hash.rb": "3efe69f1eb189b2913e178b8472aaede",
|
204
|
+
"lib/puppet/provider/database/mysql.rb": "66e7506c4823bb5ea150ca3c1b62bc98",
|
205
|
+
"lib/puppet/provider/database_grant/mysql.rb": "163fd7c65bc3e1371393f3d5c8d6ae10",
|
206
|
+
"lib/puppet/provider/database_user/mysql.rb": "47f13b62d5bb05ae7184e50a6a38a13c",
|
207
|
+
"lib/puppet/provider/mysql.rb": "e8eb4be7cead5b8627ccaea1f435c95a",
|
208
|
+
"lib/puppet/provider/mysql_database/mysql.rb": "466af4dc5e7689b47a9322f4d8a9b3f2",
|
209
|
+
"lib/puppet/provider/mysql_grant/mysql.rb": "f27f8cc23f74ce59a49172d8e6a0d5dc",
|
210
|
+
"lib/puppet/provider/mysql_user/mysql.rb": "87aee13a24a2d01ed34e3b91b9297e40",
|
211
|
+
"lib/puppet/type/database.rb": "7b4b49b841d41541ce719d1a051ee94b",
|
212
|
+
"lib/puppet/type/database_grant.rb": "66fce5df0f3f4111fe37f094965f6f93",
|
213
|
+
"lib/puppet/type/database_user.rb": "b2a87e3854324fb0ae407a1fbad5802a",
|
214
|
+
"lib/puppet/type/mysql_database.rb": "e21a38611edc6cba5454889170bc0ebc",
|
215
|
+
"lib/puppet/type/mysql_grant.rb": "9e34c78952e5fcc073f089e58ab35cf3",
|
216
|
+
"lib/puppet/type/mysql_user.rb": "ddb054a5fd03689ae4325fbe003a41d3",
|
217
|
+
"manifests/backup.pp": "dfa324a48d47935a8423b102458c6516",
|
218
|
+
"manifests/bindings.pp": "5976e9b74a29cc3a102f49867709a08f",
|
219
|
+
"manifests/bindings/java.pp": "6a581f1da1690d436ae14832af551ca2",
|
220
|
+
"manifests/bindings/perl.pp": "e765d0792afacbe72cf3e65804b78fe7",
|
221
|
+
"manifests/bindings/php.pp": "09017ca0adefbb8bf894393371cfad94",
|
222
|
+
"manifests/bindings/python.pp": "50c22f04074695f17ea383b307d01ea3",
|
223
|
+
"manifests/bindings/ruby.pp": "99f7c01e468136c8e699fcbb36d037fa",
|
224
|
+
"manifests/client.pp": "ab5a3ece8f5c4cc2174532472bdc5afe",
|
225
|
+
"manifests/client/install.pp": "381f70bfbaac921d631e3b115d8ae264",
|
226
|
+
"manifests/db.pp": "0dd59f8d1578c25a2517d4fda862624b",
|
227
|
+
"manifests/init.pp": "52ad9ac01674695edaf62cc1c48ef4f8",
|
228
|
+
"manifests/params.pp": "033b2e0f88f15b2d8aab3b08ed470abd",
|
229
|
+
"manifests/server.pp": "1bafcd02849a12efaa2271e55380393b",
|
230
|
+
"manifests/server/account_security.pp": "c793a434142ddaa6a529ed59739368fb",
|
231
|
+
"manifests/server/backup.pp": "ff6239ff4e2c46f42ec9b34a805c6718",
|
232
|
+
"manifests/server/config.pp": "dcc92deb6e2e100bf150016a8fb2a42d",
|
233
|
+
"manifests/server/install.pp": "8666481a3ea12e9f76c47dfa558c09e6",
|
234
|
+
"manifests/server/monitor.pp": "a63731018c171de9e441009d453dcac8",
|
235
|
+
"manifests/server/mysqltuner.pp": "4b19b075ecb7a7054cac237e5f50ed16",
|
236
|
+
"manifests/server/providers.pp": "87a019dce5bbb6b18c9aa61b5f99134c",
|
237
|
+
"manifests/server/root_password.pp": "73738c1b6ee42b896db5356575c95af6",
|
238
|
+
"manifests/server/service.pp": "e79e2206b06d41956fb6d87fc1d20aa0",
|
239
|
+
"spec/classes/mysql_bindings_spec.rb": "cfc90d020af62a2315129c84f6acc7d9",
|
240
|
+
"spec/classes/mysql_client_spec.rb": "1849bea122f7282153cbc46ca04aa851",
|
241
|
+
"spec/classes/mysql_server_account_security_spec.rb": "e223281077baa230fb6b7387f56af6d8",
|
242
|
+
"spec/classes/mysql_server_backup_spec.rb": "4c7e64b955bf1df76aead3bf93c2ae1c",
|
243
|
+
"spec/classes/mysql_server_monitor_spec.rb": "2bf20049616769424afd4a5137e25511",
|
244
|
+
"spec/classes/mysql_server_mysqltuner_spec.rb": "7a098808c21e3f08cd26237a96acc878",
|
245
|
+
"spec/classes/mysql_server_spec.rb": "bc2dccc7ea00340a048ac91d602c1ac0",
|
246
|
+
"spec/defines/mysql_db_spec.rb": "26b348846df5013819c7c9f18090ffc4",
|
247
|
+
"spec/spec.opts": "a600ded995d948e393fbe2320ba8e51c",
|
248
|
+
"spec/spec_helper.rb": "92fefec2bd21423ec2aece165375678b",
|
249
|
+
"spec/spec_helper_system.rb": "30ef76d722878ce9049203e753663335",
|
250
|
+
"spec/system/mysql_account_delete_spec.rb": "ff8d45ad704f7e3c5fdcae7a4be2ea6e",
|
251
|
+
"spec/system/mysql_backup_spec.rb": "e30ef8f335f216afa489077643f57c98",
|
252
|
+
"spec/system/mysql_bindings_spec.rb": "1e8cb8b2eb50ee3a7f663d6bc979ae2d",
|
253
|
+
"spec/system/mysql_db_spec.rb": "798771e3185a52fdc29513bf4eb33d15",
|
254
|
+
"spec/system/mysql_server_monitor_spec.rb": "5f282becde15a434aee3f56c99e61ca2",
|
255
|
+
"spec/system/mysql_server_root_password_spec.rb": "3e8fd20f19e0803dcd20cdac5f0179c8",
|
256
|
+
"spec/system/mysql_server_spec.rb": "f3039e1e7737712ca45d7e14e2cad28f",
|
257
|
+
"spec/system/types/mysql_grant_spec.rb": "7224f1d7d44e63a5d3a44b43cc38be5d",
|
258
|
+
"spec/system/types/mysql_user_spec.rb": "63f1d4c5136291b3cfba33a07e8bb37d",
|
259
|
+
"spec/unit/mysql_password_spec.rb": "7e1f9c635cb9dd4143054e096515006b",
|
260
|
+
"spec/unit/puppet/functions/mysql_deepmerge_spec.rb": "6b33280aa390e1e7788168df65499fd5",
|
261
|
+
"spec/unit/puppet/provider/database/mysql_spec.rb": "3bb92bdaaddfd54e7700012b2418f1ba",
|
262
|
+
"spec/unit/puppet/provider/database_grant/mysql_spec.rb": "261c22e57374b6651b87fcac86c9b563",
|
263
|
+
"spec/unit/puppet/provider/database_user/mysql_spec.rb": "50709cf2cf3f852a56de1856222b9b1f",
|
264
|
+
"spec/unit/puppet/provider/mysql_database/mysql_spec.rb": "86bfe78acaefd34ed195742e9aff5896",
|
265
|
+
"spec/unit/puppet/provider/mysql_user/mysql_spec.rb": "d59edf286efa51990d0db1c0307e91ea",
|
266
|
+
"spec/unit/puppet/type/mysql_database_spec.rb": "0b32abc822e7613bdbb46f0a35c5b999",
|
267
|
+
"spec/unit/puppet/type/mysql_user_spec.rb": "1a20ac660f54f9976bb5a0c03c339efc",
|
268
|
+
"templates/my.cnf.erb": "0cb43aad4d2c5903cad87bffa3569348",
|
269
|
+
"templates/my.cnf.pass.erb": "30b24a3f29fcc644bd3a73929305cda0",
|
270
|
+
"templates/my.conf.cnf.erb": "5ebda0d5d774b2a51c25c43fbfed544a",
|
271
|
+
"templates/mysqlbackup.sh.erb": "b5ca36fac16da99ec88344addd03b997",
|
272
|
+
"tests/backup.pp": "caae4da564c1f663341bbe50915a5f7d",
|
273
|
+
"tests/bindings.pp": "dda8795d67098b66aa65e81ccc48ed73",
|
274
|
+
"tests/init.pp": "6b34827ac4731829c8a117f0b3fb8167",
|
275
|
+
"tests/java.pp": "0ad9de4f9f2c049642bcf08124757085",
|
276
|
+
"tests/mysql_database.pp": "2a85cd95a9952e3d93aa05f8f236551e",
|
277
|
+
"tests/mysql_grant.pp": "cd42336a6c7b2d27f5d5d6d0e310ee1a",
|
278
|
+
"tests/mysql_user.pp": "7aa29740f3b6cd8a7041d59af2d595cc",
|
279
|
+
"tests/perl.pp": "6e496f19eaae83c90ce8b93236d44bca",
|
280
|
+
"tests/python.pp": "b093828acfed9c14e25ebdd60d90c282",
|
281
|
+
"tests/ruby.pp": "6c5071fcaf731995c9b8e31e00eaffa0",
|
282
|
+
"tests/server.pp": "72e22552a95b9a5e4a349dbfc13639dc",
|
283
|
+
"tests/server/account_security.pp": "47f79d7ae9eac2bf2134db27abf1db37",
|
284
|
+
"tests/server/config.pp": "619b4220138a12c6cb5f10af9867d8a1"
|
285
|
+
},
|
286
|
+
"source": "git://github.com/puppetlabs/puppetlabs-mysql.git",
|
287
|
+
"project_page": "http://github.com/puppetlabs/puppetlabs-mysql",
|
288
|
+
"license": "Apache 2.0"
|
289
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'mysql::bindings' do
|
4
|
+
let(:params) {{
|
5
|
+
'java_enable' => true,
|
6
|
+
'perl_enable' => true,
|
7
|
+
'php_enable' => true,
|
8
|
+
'python_enable' => true,
|
9
|
+
'ruby_enable' => true,
|
10
|
+
}}
|
11
|
+
|
12
|
+
shared_examples 'bindings' do |osfamily, operatingsystem, java_name, perl_name, php_name, python_name, ruby_name|
|
13
|
+
let :facts do
|
14
|
+
{ :osfamily => osfamily, :operatingsystem => operatingsystem, :root_home => '/root'}
|
15
|
+
end
|
16
|
+
it { should contain_package('mysql-connector-java').with(
|
17
|
+
:name => java_name,
|
18
|
+
:ensure => 'present'
|
19
|
+
)}
|
20
|
+
it { should contain_package('perl_mysql').with(
|
21
|
+
:name => perl_name,
|
22
|
+
:ensure => 'present'
|
23
|
+
)}
|
24
|
+
it { should contain_package('python-mysqldb').with(
|
25
|
+
:name => python_name,
|
26
|
+
:ensure => 'present'
|
27
|
+
)}
|
28
|
+
it { should contain_package('ruby_mysql').with(
|
29
|
+
:name => ruby_name,
|
30
|
+
:ensure => 'present'
|
31
|
+
)}
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'Debian' do
|
35
|
+
it_behaves_like 'bindings', 'Debian', 'Debian', 'libmysql-java', 'libdbd-mysql-perl', 'php5-mysql', 'python-mysqldb', 'libmysql-ruby'
|
36
|
+
it_behaves_like 'bindings', 'Debian', 'Ubuntu', 'libmysql-java', 'libdbd-mysql-perl', 'php5-mysql', 'python-mysqldb', 'libmysql-ruby'
|
37
|
+
end
|
38
|
+
|
39
|
+
context 'freebsd' do
|
40
|
+
it_behaves_like 'bindings', 'FreeBSD', 'FreeBSD', 'databases/mysql-connector-java', 'p5-DBD-mysql', 'databases/php5-mysql', 'databases/py-MySQLdb', 'databases/ruby-mysql'
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'redhat' do
|
44
|
+
it_behaves_like 'bindings', 'RedHat', 'RedHat', 'mysql-connector-java', 'perl-DBD-MySQL', 'php-mysql', 'MySQL-python', 'ruby-mysql'
|
45
|
+
it_behaves_like 'bindings', 'RedHat', 'OpenSuSE', 'mysql-connector-java', 'perl-DBD-MySQL', 'php-mysql', 'MySQL-python', 'ruby-mysql'
|
46
|
+
end
|
47
|
+
|
48
|
+
describe 'on any other os' do
|
49
|
+
let :facts do
|
50
|
+
{:osfamily => 'foo', :root_home => '/root'}
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'should fail' do
|
54
|
+
expect { subject }.to raise_error(/Unsupported osfamily: foo/)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
describe 'mysql::client' do
|
2
|
+
let(:facts) {{ :osfamily => 'RedHat' }}
|
3
|
+
|
4
|
+
context 'with defaults' do
|
5
|
+
it { should_not contain_class('mysql::bindings') }
|
6
|
+
it { should contain_package('mysql_client') }
|
7
|
+
end
|
8
|
+
|
9
|
+
context 'with bindings enabled' do
|
10
|
+
let(:params) {{ :bindings_enable => true }}
|
11
|
+
|
12
|
+
it { should contain_class('mysql::bindings') }
|
13
|
+
it { should contain_package('mysql_client') }
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'mysql::server::account_security' do
|
4
|
+
|
5
|
+
let :facts do {
|
6
|
+
:fqdn => 'myhost.mydomain',
|
7
|
+
:hostname => 'myhost',
|
8
|
+
:root_home => '/root'
|
9
|
+
}
|
10
|
+
end
|
11
|
+
|
12
|
+
it 'should remove Mysql_User[root@myhost.mydomain]' do
|
13
|
+
should contain_mysql_user('root@myhost.mydomain').with_ensure('absent')
|
14
|
+
end
|
15
|
+
it 'should remove Mysql_User[root@myhost]' do
|
16
|
+
should contain_mysql_user('root@myhost').with_ensure('absent')
|
17
|
+
end
|
18
|
+
it 'should remove Mysql_User[root@127.0.0.1]' do
|
19
|
+
should contain_mysql_user('root@127.0.0.1').with_ensure('absent')
|
20
|
+
end
|
21
|
+
it 'should remove Mysql_User[root@::1]' do
|
22
|
+
should contain_mysql_user('root@::1').with_ensure('absent')
|
23
|
+
end
|
24
|
+
it 'should remove Mysql_User[@myhost.mydomain]' do
|
25
|
+
should contain_mysql_user('@myhost.mydomain').with_ensure('absent')
|
26
|
+
end
|
27
|
+
it 'should remove Mysql_User[@myhost]' do
|
28
|
+
should contain_mysql_user('@myhost').with_ensure('absent')
|
29
|
+
end
|
30
|
+
it 'should remove Mysql_User[@localhost]' do
|
31
|
+
should contain_mysql_user('@localhost').with_ensure('absent')
|
32
|
+
end
|
33
|
+
it 'should remove Mysql_User[@%]' do
|
34
|
+
should contain_mysql_user('@%').with_ensure('absent')
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'should remove Mysql_database[test]' do
|
38
|
+
should contain_mysql_database('test').with_ensure('absent')
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe 'mysql::server::backup' do
|
4
|
+
|
5
|
+
let(:default_params) {
|
6
|
+
{ 'backupuser' => 'testuser',
|
7
|
+
'backuppassword' => 'testpass',
|
8
|
+
'backupdir' => '/tmp',
|
9
|
+
'backuprotate' => '25',
|
10
|
+
'delete_before_dump' => true,
|
11
|
+
}
|
12
|
+
}
|
13
|
+
context 'standard conditions' do
|
14
|
+
let(:params) { default_params }
|
15
|
+
|
16
|
+
it { should contain_mysql_user('testuser@localhost')}
|
17
|
+
|
18
|
+
it { should contain_mysql_grant('testuser@localhost/*.*').with(
|
19
|
+
:privileges => ["SELECT", "RELOAD", "LOCK TABLES", "SHOW VIEW"]
|
20
|
+
)}
|
21
|
+
|
22
|
+
it { should contain_cron('mysql-backup').with(
|
23
|
+
:command => '/usr/local/sbin/mysqlbackup.sh',
|
24
|
+
:ensure => 'present'
|
25
|
+
)}
|
26
|
+
|
27
|
+
it { should contain_file('mysqlbackup.sh').with(
|
28
|
+
:path => '/usr/local/sbin/mysqlbackup.sh',
|
29
|
+
:ensure => 'present'
|
30
|
+
) }
|
31
|
+
|
32
|
+
it { should contain_file('mysqlbackupdir').with(
|
33
|
+
:path => '/tmp',
|
34
|
+
:ensure => 'directory'
|
35
|
+
)}
|
36
|
+
|
37
|
+
it 'should have compression by default' do
|
38
|
+
verify_contents(subject, 'mysqlbackup.sh', [
|
39
|
+
' --all-databases | bzcat -zc > ${DIR}/${PREFIX}`date +%Y%m%d-%H%M%S`.sql.bz2',
|
40
|
+
])
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'should have 25 days of rotation' do
|
44
|
+
# MySQL counts from 0 I guess.
|
45
|
+
should contain_file('mysqlbackup.sh').with_content(/.*ROTATE=24.*/)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'with compression disabled' do
|
50
|
+
let(:params) do
|
51
|
+
{ :backupcompress => false }.merge(default_params)
|
52
|
+
end
|
53
|
+
|
54
|
+
it { should contain_file('mysqlbackup.sh').with(
|
55
|
+
:path => '/usr/local/sbin/mysqlbackup.sh',
|
56
|
+
:ensure => 'present'
|
57
|
+
) }
|
58
|
+
|
59
|
+
it 'should be able to disable compression' do
|
60
|
+
verify_contents(subject, 'mysqlbackup.sh', [
|
61
|
+
' --all-databases > ${DIR}/${PREFIX}`date +%Y%m%d-%H%M%S`.sql',
|
62
|
+
])
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
context 'with database list specified' do
|
67
|
+
let(:params) do
|
68
|
+
{ :backupdatabases => ['mysql'] }.merge(default_params)
|
69
|
+
end
|
70
|
+
|
71
|
+
it { should contain_file('mysqlbackup.sh').with(
|
72
|
+
:path => '/usr/local/sbin/mysqlbackup.sh',
|
73
|
+
:ensure => 'present'
|
74
|
+
) }
|
75
|
+
|
76
|
+
it 'should have a backup file for each database' do
|
77
|
+
content = catalogue.resource('file','mysqlbackup.sh').send(:parameters)[:content]
|
78
|
+
content.should match(' mysql | bzcat -zc \${DIR}\\\${PREFIX}mysql_`date')
|
79
|
+
# verify_contents(subject, 'mysqlbackup.sh', [
|
80
|
+
# ' mysql | bzcat -zc ${DIR}/${PREFIX}mysql_`date +%Y%m%d-%H%M%S`.sql',
|
81
|
+
# ])
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
context 'with file per database' do
|
86
|
+
let(:params) do
|
87
|
+
default_params.merge({ :file_per_database => true })
|
88
|
+
end
|
89
|
+
|
90
|
+
it 'should loop through backup all databases' do
|
91
|
+
verify_contents(subject, 'mysqlbackup.sh', [
|
92
|
+
'mysql -s -r -N -e \'SHOW DATABASES\' | while read dbname',
|
93
|
+
'do',
|
94
|
+
' mysqldump -u${USER} -p${PASS} --opt --flush-logs --single-transaction \\',
|
95
|
+
' ${dbname} | bzcat -zc > ${DIR}/${PREFIX}${dbname}_`date +%Y%m%d-%H%M%S`.sql.bz2',
|
96
|
+
'done',
|
97
|
+
])
|
98
|
+
end
|
99
|
+
|
100
|
+
context 'with compression disabled' do
|
101
|
+
let(:params) do
|
102
|
+
default_params.merge({ :file_per_database => true, :backupcompress => false })
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'should loop through backup all databases without compression' do
|
106
|
+
verify_contents(subject, 'mysqlbackup.sh', [
|
107
|
+
' ${dbname} > ${DIR}/${PREFIX}${dbname}_`date +%Y%m%d-%H%M%S`.sql',
|
108
|
+
])
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
describe 'mysql::server::monitor' do
|
3
|
+
let :facts do
|
4
|
+
{ :osfamily => 'Debian', :root_home => '/root' }
|
5
|
+
end
|
6
|
+
let :pre_condition do
|
7
|
+
"include 'mysql::server'"
|
8
|
+
end
|
9
|
+
|
10
|
+
let :default_params do
|
11
|
+
{
|
12
|
+
:mysql_monitor_username => 'monitoruser',
|
13
|
+
:mysql_monitor_password => 'monitorpass',
|
14
|
+
:mysql_monitor_hostname => 'monitorhost',
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
let :params do
|
19
|
+
default_params
|
20
|
+
end
|
21
|
+
|
22
|
+
it { should contain_mysql_user('monitoruser@monitorhost')}
|
23
|
+
|
24
|
+
it { should contain_mysql_grant('monitoruser@monitorhost/*.*').with(
|
25
|
+
:ensure => 'present',
|
26
|
+
:user => 'monitoruser@monitorhost',
|
27
|
+
:table => '*.*',
|
28
|
+
:privileges => ["PROCESS", "SUPER"],
|
29
|
+
:require => 'Mysql_user[monitoruser@monitorhost]'
|
30
|
+
)}
|
31
|
+
end
|