elzar 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.chef/knife.rb +3 -0
- data/.gitignore +1 -0
- data/.rvmrc +1 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +96 -0
- data/README.md +42 -0
- data/Rakefile +1 -0
- data/Vagrantfile +16 -0
- data/cookbooks/.gitkeep +0 -0
- data/cookbooks/apt/README.md +122 -0
- data/cookbooks/apt/files/default/apt-cacher +9 -0
- data/cookbooks/apt/files/default/apt-cacher.conf +144 -0
- data/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
- data/cookbooks/apt/metadata.rb +13 -0
- data/cookbooks/apt/providers/repository.rb +73 -0
- data/cookbooks/apt/recipes/cacher-client.rb +44 -0
- data/cookbooks/apt/recipes/cacher.rb +45 -0
- data/cookbooks/apt/recipes/default.rb +50 -0
- data/cookbooks/apt/resources/repository.rb +30 -0
- data/cookbooks/build-essential/README.md +24 -0
- data/cookbooks/build-essential/metadata.rb +10 -0
- data/cookbooks/build-essential/recipes/default.rb +45 -0
- data/cookbooks/database/README.md +403 -0
- data/cookbooks/database/libraries/provider_database_mysql.rb +97 -0
- data/cookbooks/database/libraries/provider_database_mysql_user.rb +76 -0
- data/cookbooks/database/libraries/provider_database_postgresql.rb +126 -0
- data/cookbooks/database/libraries/provider_database_postgresql_user.rb +78 -0
- data/cookbooks/database/libraries/provider_database_sql_server.rb +109 -0
- data/cookbooks/database/libraries/provider_database_sql_server_user.rb +106 -0
- data/cookbooks/database/libraries/resource_database.rb +111 -0
- data/cookbooks/database/libraries/resource_database_user.rb +90 -0
- data/cookbooks/database/libraries/resource_mysql_database.rb +34 -0
- data/cookbooks/database/libraries/resource_mysql_database_user.rb +34 -0
- data/cookbooks/database/libraries/resource_postgresql_database.rb +35 -0
- data/cookbooks/database/libraries/resource_postgresql_database_user.rb +35 -0
- data/cookbooks/database/libraries/resource_sql_server_database.rb +34 -0
- data/cookbooks/database/libraries/resource_sql_server_database_user.rb +34 -0
- data/cookbooks/database/metadata.rb +21 -0
- data/cookbooks/database/recipes/default.rb +20 -0
- data/cookbooks/database/recipes/ebs_backup.rb +89 -0
- data/cookbooks/database/recipes/ebs_volume.rb +196 -0
- data/cookbooks/database/recipes/master.rb +78 -0
- data/cookbooks/database/recipes/snapshot.rb +62 -0
- data/cookbooks/database/templates/default/app_grants.sql.erb +8 -0
- data/cookbooks/database/templates/default/aws_config.erb +3 -0
- data/cookbooks/database/templates/default/chef-solo-database-snapshot.cron.erb +10 -0
- data/cookbooks/database/templates/default/chef-solo-database-snapshot.json.erb +1 -0
- data/cookbooks/database/templates/default/chef-solo-database-snapshot.rb.erb +6 -0
- data/cookbooks/database/templates/default/ebs-backup-cron.erb +2 -0
- data/cookbooks/database/templates/default/ebs-db-backup.sh.erb +8 -0
- data/cookbooks/database/templates/default/ebs-db-restore.sh.erb +10 -0
- data/cookbooks/database/templates/default/s3cfg.erb +27 -0
- data/cookbooks/mysql/README.md +148 -0
- data/cookbooks/mysql/attributes/server.rb +68 -0
- data/cookbooks/mysql/libraries/database.rb +19 -0
- data/cookbooks/mysql/libraries/helpers.rb +33 -0
- data/cookbooks/mysql/metadata.rb +90 -0
- data/cookbooks/mysql/recipes/client.rb +51 -0
- data/cookbooks/mysql/recipes/default.rb +20 -0
- data/cookbooks/mysql/recipes/server.rb +133 -0
- data/cookbooks/mysql/recipes/server_ec2.rb +49 -0
- data/cookbooks/mysql/templates/default/debian.cnf.erb +12 -0
- data/cookbooks/mysql/templates/default/grants.sql.erb +15 -0
- data/cookbooks/mysql/templates/default/my.cnf.erb +176 -0
- data/cookbooks/mysql/templates/default/mysql-server.seed.erb +10 -0
- data/cookbooks/mysql/templates/default/port_mysql.erb +3 -0
- data/cookbooks/openssl/README.md +37 -0
- data/cookbooks/openssl/libraries/secure_password.rb +37 -0
- data/cookbooks/openssl/metadata.rb +8 -0
- data/cookbooks/openssl/recipes/default.rb +19 -0
- data/cookbooks/passenger_enterprise/README.rdoc +8 -0
- data/cookbooks/passenger_enterprise/attributes/default.rb +28 -0
- data/cookbooks/passenger_enterprise/cc.gemspec +36 -0
- data/cookbooks/passenger_enterprise/metadata.json +44 -0
- data/cookbooks/passenger_enterprise/metadata.rb +16 -0
- data/cookbooks/passenger_enterprise/recipes/apache2.rb +54 -0
- data/cookbooks/passenger_enterprise/recipes/default.rb +30 -0
- data/cookbooks/passenger_enterprise/recipes/nginx.rb +50 -0
- data/cookbooks/passenger_enterprise/templates/default/passenger.conf.erb +2 -0
- data/cookbooks/passenger_enterprise/templates/default/passenger.load.erb +1 -0
- data/cookbooks/passenger_enterprise/templates/default/passenger_nginx.conf.erb +2 -0
- data/cookbooks/ruby_enterprise/README.rdoc +55 -0
- data/cookbooks/ruby_enterprise/attributes/default.rb +33 -0
- data/cookbooks/ruby_enterprise/cc.gemspec +36 -0
- data/cookbooks/ruby_enterprise/definitions/ree_gem.rb +28 -0
- data/cookbooks/ruby_enterprise/metadata.json +45 -0
- data/cookbooks/ruby_enterprise/metadata.rb +13 -0
- data/cookbooks/ruby_enterprise/recipes/default.rb +67 -0
- data/data_bags/deploy/authorized_keys.json +9 -0
- data/dna.json +25 -0
- data/elzar.gemspec +22 -0
- data/lib/elzar.rb +21 -0
- data/lib/elzar/assistant.rb +77 -0
- data/lib/elzar/chef_dna.rb +48 -0
- data/lib/elzar/template.rb +24 -0
- data/lib/elzar/templates/Gemfile +11 -0
- data/lib/elzar/templates/Vagrantfile.erb +16 -0
- data/lib/elzar/templates/dna.json +25 -0
- data/lib/elzar/templates/solo.rb.erb +6 -0
- data/lib/elzar/version.rb +3 -0
- data/roles/enterprise_appstack.rb +4 -0
- data/roles/plumbing.rb +11 -0
- data/roles/postgres_database.rb +4 -0
- data/roles/ruby_appstack.rb +4 -0
- data/script/install_cookbook +6 -0
- data/script/new_cookbook +5 -0
- data/site-cookbooks/.gitkeep +0 -0
- data/site-cookbooks/curl/README.md +17 -0
- data/site-cookbooks/curl/metadata.rb +6 -0
- data/site-cookbooks/curl/recipes/default.rb +11 -0
- data/site-cookbooks/nginx/CHANGELOG.md +11 -0
- data/site-cookbooks/nginx/CONTRIBUTING +29 -0
- data/site-cookbooks/nginx/LICENSE +201 -0
- data/site-cookbooks/nginx/README.md +76 -0
- data/site-cookbooks/nginx/attributes/default.rb +65 -0
- data/site-cookbooks/nginx/definitions/nginx_site.rb +35 -0
- data/site-cookbooks/nginx/files/default/mime.types +73 -0
- data/site-cookbooks/nginx/metadata.rb +89 -0
- data/site-cookbooks/nginx/recipes/default.rb +57 -0
- data/site-cookbooks/nginx/recipes/source.rb +126 -0
- data/site-cookbooks/nginx/templates/default/default-site.erb +11 -0
- data/site-cookbooks/nginx/templates/default/nginx.conf.erb +42 -0
- data/site-cookbooks/nginx/templates/default/nginx.init.erb +91 -0
- data/site-cookbooks/nginx/templates/default/nxdissite.erb +29 -0
- data/site-cookbooks/nginx/templates/default/nxensite.erb +38 -0
- data/site-cookbooks/passenger/README.md +12 -0
- data/site-cookbooks/passenger/attributes/default.rb +3 -0
- data/site-cookbooks/passenger/metadata.rb +6 -0
- data/site-cookbooks/passenger/recipes/default.rb +39 -0
- data/site-cookbooks/passenger/templates/default/passenger_nginx.conf.erb +2 -0
- data/site-cookbooks/postgresql/README.md +150 -0
- data/site-cookbooks/postgresql/attributes/default.rb +72 -0
- data/site-cookbooks/postgresql/metadata.rb +21 -0
- data/site-cookbooks/postgresql/recipes/client.rb +40 -0
- data/site-cookbooks/postgresql/recipes/default.rb +20 -0
- data/site-cookbooks/postgresql/recipes/server.rb +74 -0
- data/site-cookbooks/postgresql/recipes/server_debian.rb +62 -0
- data/site-cookbooks/postgresql/recipes/server_redhat.rb +82 -0
- data/site-cookbooks/postgresql/templates/default/debian.postgresql.conf.erb +499 -0
- data/site-cookbooks/postgresql/templates/default/pg_hba.conf.erb +83 -0
- data/site-cookbooks/postgresql/templates/default/redhat.postgresql.conf.erb +501 -0
- data/site-cookbooks/rails_app/README.md +15 -0
- data/site-cookbooks/rails_app/attributes/default.rb +2 -0
- data/site-cookbooks/rails_app/files/default/sudoers +26 -0
- data/site-cookbooks/rails_app/metadata.rb +6 -0
- data/site-cookbooks/rails_app/recipes/default.rb +143 -0
- data/site-cookbooks/rails_app/recipes/system_libraries.rb +12 -0
- data/site-cookbooks/rails_app/templates/default/pg_hba.conf.erb +84 -0
- data/site-cookbooks/rails_app/templates/default/rails_app_nginx.erb +10 -0
- data/site-cookbooks/ruby/README.md +12 -0
- data/site-cookbooks/ruby/attributes/default.rb +6 -0
- data/site-cookbooks/ruby/metadata.rb +6 -0
- data/site-cookbooks/ruby/recipes/default.rb +54 -0
- data/solo.rb +7 -0
- data/upgrade-chef.sh +8 -0
- metadata +272 -0
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
require File.join(File.dirname(__FILE__), 'provider_database_sql_server')
|
|
20
|
+
|
|
21
|
+
class Chef
|
|
22
|
+
class Provider
|
|
23
|
+
class Database
|
|
24
|
+
class SqlServerUser < Chef::Provider::Database::SqlServer
|
|
25
|
+
include Chef::Mixin::ShellOut
|
|
26
|
+
|
|
27
|
+
def load_current_resource
|
|
28
|
+
Gem.clear_paths
|
|
29
|
+
require 'tiny_tds'
|
|
30
|
+
@current_resource = Chef::Resource::DatabaseUser.new(@new_resource.name)
|
|
31
|
+
@current_resource.username(@new_resource.name)
|
|
32
|
+
@current_resource
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def action_create
|
|
36
|
+
begin
|
|
37
|
+
unless exists?(:logins)
|
|
38
|
+
db.execute("CREATE LOGIN #{@new_resource.username} WITH PASSWORD = '#{@new_resource.password}', CHECK_POLICY = OFF").do
|
|
39
|
+
@new_resource.updated_by_last_action(true)
|
|
40
|
+
end
|
|
41
|
+
unless exists?(:users)
|
|
42
|
+
if @new_resource.database_name
|
|
43
|
+
Chef::Log.info("#{@new_resource} creating user in '#{@new_resource.database_name}' database context.")
|
|
44
|
+
db.execute("USE #{@new_resource.database_name}").do
|
|
45
|
+
else
|
|
46
|
+
Chef::Log.info("#{@new_resource} database_name not provided, creating user in global context.")
|
|
47
|
+
end
|
|
48
|
+
db.execute("CREATE USER #{@new_resource.username} FOR LOGIN #{@new_resource.username}").do
|
|
49
|
+
@new_resource.updated_by_last_action(true)
|
|
50
|
+
end
|
|
51
|
+
ensure
|
|
52
|
+
close
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def action_drop
|
|
57
|
+
begin
|
|
58
|
+
if exists?(:users)
|
|
59
|
+
db.execute("DROP USER #{@new_resource.username}").do
|
|
60
|
+
@new_resource.updated_by_last_action(true)
|
|
61
|
+
end
|
|
62
|
+
if exists?(:logins)
|
|
63
|
+
db.execute("DROP LOGIN #{@new_resource.username}").do
|
|
64
|
+
@new_resource.updated_by_last_action(true)
|
|
65
|
+
end
|
|
66
|
+
ensure
|
|
67
|
+
close
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def action_grant
|
|
72
|
+
begin
|
|
73
|
+
if @new_resource.password
|
|
74
|
+
action_create
|
|
75
|
+
end
|
|
76
|
+
Chef::Application.fatal!('Please provide a database_name, SQL Server does not support global GRANT statements.') unless @new_resource.database_name
|
|
77
|
+
grant_statement = "GRANT #{@new_resource.privileges.join(', ')} ON DATABASE::#{@new_resource.database_name} TO #{@new_resource.username}"
|
|
78
|
+
Chef::Log.info("#{@new_resource} granting access with statement [#{grant_statement}]")
|
|
79
|
+
db.execute("USE #{@new_resource.database_name}").do
|
|
80
|
+
db.execute(grant_statement).do
|
|
81
|
+
@new_resource.updated_by_last_action(true)
|
|
82
|
+
ensure
|
|
83
|
+
close
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
private
|
|
88
|
+
def exists?(type=:users)
|
|
89
|
+
case type
|
|
90
|
+
when :users
|
|
91
|
+
table = "database_principals"
|
|
92
|
+
if @new_resource.database_name
|
|
93
|
+
Chef::Log.debug("#{@new_resource} searching for existing user in '#{@new_resource.database_name}' database context.")
|
|
94
|
+
db.execute("USE #{@new_resource.database_name}").do
|
|
95
|
+
end
|
|
96
|
+
when :logins
|
|
97
|
+
table = "server_principals"
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
result = db.execute("SELECT name FROM sys.#{table} WHERE name='#{@new_resource.username}'")
|
|
101
|
+
result.each.any?
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
require 'chef/resource'
|
|
20
|
+
|
|
21
|
+
class Chef
|
|
22
|
+
class Resource
|
|
23
|
+
class Database < Chef::Resource
|
|
24
|
+
|
|
25
|
+
def initialize(name, run_context=nil)
|
|
26
|
+
super
|
|
27
|
+
@resource_name = :database
|
|
28
|
+
@database_name = name
|
|
29
|
+
@allowed_actions.push(:create, :drop, :query)
|
|
30
|
+
@action = :create
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def database_name(arg=nil)
|
|
34
|
+
set_or_return(
|
|
35
|
+
:database_name,
|
|
36
|
+
arg,
|
|
37
|
+
:kind_of => String
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def connection(arg=nil)
|
|
42
|
+
set_or_return(
|
|
43
|
+
:connection,
|
|
44
|
+
arg,
|
|
45
|
+
:required => true
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def sql(arg=nil)
|
|
50
|
+
set_or_return(
|
|
51
|
+
:sql,
|
|
52
|
+
arg,
|
|
53
|
+
:kind_of => String
|
|
54
|
+
)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def sql(arg=nil)
|
|
58
|
+
set_or_return(
|
|
59
|
+
:sql,
|
|
60
|
+
arg,
|
|
61
|
+
:kind_of => String
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
#
|
|
66
|
+
def template(arg=nil)
|
|
67
|
+
set_or_return(
|
|
68
|
+
:template,
|
|
69
|
+
arg,
|
|
70
|
+
:kind_of => String,
|
|
71
|
+
:default => 'DEFAULT'
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def encoding(arg=nil)
|
|
76
|
+
set_or_return(
|
|
77
|
+
:encoding,
|
|
78
|
+
arg,
|
|
79
|
+
:kind_of => String,
|
|
80
|
+
:default => 'DEFAULT'
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def tablespace(arg=nil)
|
|
85
|
+
set_or_return(
|
|
86
|
+
:tablespace,
|
|
87
|
+
arg,
|
|
88
|
+
:kind_of => String,
|
|
89
|
+
:default => 'DEFAULT'
|
|
90
|
+
)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def connection_limit(arg=nil)
|
|
94
|
+
set_or_return(
|
|
95
|
+
:connection_limit,
|
|
96
|
+
arg,
|
|
97
|
+
:kind_of => String,
|
|
98
|
+
:default => '-1'
|
|
99
|
+
)
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
def owner(arg=nil)
|
|
103
|
+
set_or_return(
|
|
104
|
+
:owner,
|
|
105
|
+
arg,
|
|
106
|
+
:kind_of => String
|
|
107
|
+
)
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
require File.join(File.dirname(__FILE__), 'resource_database')
|
|
20
|
+
|
|
21
|
+
class Chef
|
|
22
|
+
class Resource
|
|
23
|
+
class DatabaseUser < Chef::Resource::Database
|
|
24
|
+
|
|
25
|
+
def initialize(name, run_context=nil)
|
|
26
|
+
super
|
|
27
|
+
@resource_name = :database_user
|
|
28
|
+
@username = name
|
|
29
|
+
|
|
30
|
+
@database_name = nil
|
|
31
|
+
@table = nil
|
|
32
|
+
@host = 'localhost'
|
|
33
|
+
@privileges = [:all]
|
|
34
|
+
|
|
35
|
+
@allowed_actions.push(:create, :drop, :grant)
|
|
36
|
+
@action = :create
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def database_name(arg=nil)
|
|
40
|
+
set_or_return(
|
|
41
|
+
:database_name,
|
|
42
|
+
arg,
|
|
43
|
+
:kind_of => String
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def username(arg=nil)
|
|
48
|
+
set_or_return(
|
|
49
|
+
:username,
|
|
50
|
+
arg,
|
|
51
|
+
:kind_of => String
|
|
52
|
+
)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def password(arg=nil)
|
|
56
|
+
set_or_return(
|
|
57
|
+
:password,
|
|
58
|
+
arg,
|
|
59
|
+
:kind_of => String,
|
|
60
|
+
:required => true
|
|
61
|
+
)
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def table(arg=nil)
|
|
65
|
+
set_or_return(
|
|
66
|
+
:table,
|
|
67
|
+
arg,
|
|
68
|
+
:kind_of => String
|
|
69
|
+
)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def host(arg=nil)
|
|
73
|
+
set_or_return(
|
|
74
|
+
:host,
|
|
75
|
+
arg,
|
|
76
|
+
:kind_of => String
|
|
77
|
+
)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
def privileges(arg=nil)
|
|
81
|
+
set_or_return(
|
|
82
|
+
:privileges,
|
|
83
|
+
arg,
|
|
84
|
+
:kind_of => Array
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
require File.join(File.dirname(__FILE__), 'resource_database')
|
|
20
|
+
require File.join(File.dirname(__FILE__), 'provider_database_mysql')
|
|
21
|
+
|
|
22
|
+
class Chef
|
|
23
|
+
class Resource
|
|
24
|
+
class MysqlDatabase < Chef::Resource::Database
|
|
25
|
+
|
|
26
|
+
def initialize(name, run_context=nil)
|
|
27
|
+
super
|
|
28
|
+
@resource_name = :mysql_database
|
|
29
|
+
@provider = Chef::Provider::Database::Mysql
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
require File.join(File.dirname(__FILE__), 'resource_database_user')
|
|
20
|
+
require File.join(File.dirname(__FILE__), 'provider_database_mysql_user')
|
|
21
|
+
|
|
22
|
+
class Chef
|
|
23
|
+
class Resource
|
|
24
|
+
class MysqlDatabaseUser < Chef::Resource::DatabaseUser
|
|
25
|
+
|
|
26
|
+
def initialize(name, run_context=nil)
|
|
27
|
+
super
|
|
28
|
+
@resource_name = :mysql_database_user
|
|
29
|
+
@provider = Chef::Provider::Database::MysqlUser
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Seth Chisamore (<schisamo@opscode.com>)
|
|
3
|
+
# Author:: Lamont Granquist (<lamont@opscode.com>)
|
|
4
|
+
# Copyright:: Copyright (c) 2011 Opscode, Inc.
|
|
5
|
+
# License:: Apache License, Version 2.0
|
|
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
|
+
require File.join(File.dirname(__FILE__), 'resource_database')
|
|
21
|
+
require File.join(File.dirname(__FILE__), 'provider_database_postgresql')
|
|
22
|
+
|
|
23
|
+
class Chef
|
|
24
|
+
class Resource
|
|
25
|
+
class PostgresqlDatabase < Chef::Resource::Database
|
|
26
|
+
|
|
27
|
+
def initialize(name, run_context=nil)
|
|
28
|
+
super
|
|
29
|
+
@resource_name = :postgresql_database
|
|
30
|
+
@provider = Chef::Provider::Database::Postgresql
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Author:: Seth Chisamore (<schisamo@opscode.com>)
|
|
3
|
+
# Author:: Lamont Granquist (<lamont@opscode.com>)
|
|
4
|
+
# Copyright:: Copyright (c) 2011 Opscode, Inc.
|
|
5
|
+
# License:: Apache License, Version 2.0
|
|
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
|
+
require File.join(File.dirname(__FILE__), 'resource_database_user')
|
|
21
|
+
require File.join(File.dirname(__FILE__), 'provider_database_postgresql_user')
|
|
22
|
+
|
|
23
|
+
class Chef
|
|
24
|
+
class Resource
|
|
25
|
+
class PostgresqlDatabaseUser < Chef::Resource::DatabaseUser
|
|
26
|
+
|
|
27
|
+
def initialize(name, run_context=nil)
|
|
28
|
+
super
|
|
29
|
+
@resource_name = :postgresql_database_user
|
|
30
|
+
@provider = Chef::Provider::Database::PostgresqlUser
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|