Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

Commit

Permalink
Get the database cookbook working (still needs tweaking)
Browse files Browse the repository at this point in the history
Sam Kottler committed Jun 19, 2014
1 parent 62d54be commit 27c36bf
Showing 3 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Berksfile.lock
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ GRAPH
yum-epel (>= 0.0.0)
motd (0.4.1)
chef_handler (>= 0.0.0)
mysql (5.3.4)
mysql (5.3.6)
yum-mysql-community (>= 0.0.0)
mysql-chef_gem (0.0.2)
build-essential (>= 0.0.0)
@@ -184,7 +184,7 @@ GRAPH
rubygems (>= 0.0.0)
rubygems-chef (0.0.2)
line (>= 0.0.0)
rubygems-database (0.0.7)
rubygems-database (0.0.14)
database (>= 0.0.0)
postgresql (>= 0.0.0)
rubygems (>= 0.0.0)
@@ -246,5 +246,5 @@ GRAPH
yum (~> 3.0)
yum-erlang_solutions (0.2.0)
yum (~> 3.0)
yum-mysql-community (0.1.6)
yum-mysql-community (0.1.8)
yum (>= 3.0.0)
2 changes: 1 addition & 1 deletion cookbooks/rubygems-database/metadata.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name 'rubygems-database'
maintainer 'RubyGems.org ops team'

version '0.0.7'
version '0.0.14'

depends 'database'
depends 'postgresql'
13 changes: 8 additions & 5 deletions cookbooks/rubygems-database/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
include_recipe 'rubygems'

node.default['postgresql']['password']['postgres'] = ''

include_recipe 'postgresql::server'
include_recipe 'postgresql::ruby'

@@ -8,17 +10,18 @@
connection_info = {
:host => '127.0.0.1',
:port => 5432,
:username => "postgres",
:password => ""
:username => 'postgres'
}

postgresql_database "rubygems_#{stage}" do
postgresql_database_user "rubygems_#{stage}" do
connection(connection_info)
password ''
action :create
end

postgresql_database_user "rubygems_#{stage}" do
connection_info['username'] = "rubygems_#{stage}"

postgresql_database "rubygems_#{stage}" do
connection(connection_info)
password ""
action :create
end

0 comments on commit 27c36bf

Please sign in to comment.