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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubygems/rubygems-chef
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 3bfdc16b6883
Choose a base ref
...
head repository: rubygems/rubygems-chef
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3fab79fee44e
Choose a head ref
  • 2 commits
  • 6 files changed
  • 1 contributor

Commits on Mar 7, 2015

  1. Copy the full SHA
    aae6fec View commit details
  2. Copy the full SHA
    3fab79f View commit details
12 changes: 6 additions & 6 deletions Berksfile.lock
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ GRAPH
chef-client (3.7.0)
cron (>= 1.2.0)
logrotate (>= 1.2.0)
chef-sugar (2.0.0)
chef-sugar (2.5.0)
chef-vault (1.1.2)
chef_handler (1.1.6)
collectd (1.0.5)
@@ -190,14 +190,14 @@ GRAPH
omnibus_updater (1.0.0)
openssh (1.3.4)
iptables (>= 0.0.0)
openssl (2.0.0)
openssl (4.0.0)
chef-sugar (>= 0.0.0)
pacman (1.1.1)
postfix (3.2.0)
postgresql (3.4.1)
postgresql (3.4.18)
apt (>= 1.9.0)
build-essential (>= 0.0.0)
openssl (>= 0.0.0)
openssl (~> 4.0.0)
python (1.4.4)
build-essential (>= 0.0.0)
yum (>= 0.0.0)
@@ -268,7 +268,7 @@ GRAPH
nginx (>= 0.0.0)
rubygems (>= 0.0.0)
rubygems-cloud-init (0.0.2)
rubygems-database (0.0.28)
rubygems-database (0.0.33)
chef-vault (>= 0.0.0)
database (>= 0.0.0)
postgresql (>= 0.0.0)
@@ -296,7 +296,7 @@ GRAPH
rubygems-logging (0.0.6)
chef-vault (>= 0.0.0)
rsyslog (>= 0.0.0)
rubygems-metrics (0.1.5)
rubygems-metrics (0.1.6)
chef-vault (>= 0.0.0)
collectd (>= 0.0.0)
collectd-librato (>= 0.0.0)
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ task :refresh_vaults do
'hubot/credentials',
'librato/credentials',
'papertrail/credentials',
'postgresql/datadog',
'rubygems/production',
'rubygems/staging',
'secrets/backups',
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.28'
version '0.0.33'

depends 'chef-vault'
depends 'database'
13 changes: 13 additions & 0 deletions cookbooks/rubygems-database/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -9,10 +9,16 @@
secrets = chef_vault_item('rubygems', node.chef_environment)
app_host = data_bag_item('hosts', 'application')['environments'][node.chef_environment]

node.default['postgresql']['version'] = '9.3'
node.default['postgresql']['config']['listen_addresses'] = '0.0.0.0'
node.default['postgresql']['config']['work_mem'] = '100MB'
node.default['postgresql']['config']['shared_buffers'] = '24MB'

apt_preference 'postgresql-9.3' do
pin 'version 9.3.5-0ubuntu0.14.04.1'
pin_priority '700'
end

# TODO: this needs to iterate over a list of application servers in the data
# bag.
node.default['postgresql']['pg_hba'] = [
@@ -23,6 +29,13 @@
'addr' => "#{search('node', "name:#{app_host}.#{node.chef_environment}.rubygems.org")[0]['ipaddress']}/0",
'method' => 'md5'
},
{
'type' => 'host',
'db' => 'postgres',
'user' => 'datadog',
'addr' => 'samehost',
'method' => 'md5'
},
{
'type' => 'local',
'db' => 'all',
2 changes: 1 addition & 1 deletion cookbooks/rubygems-metrics/metadata.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name 'rubygems-metrics'
maintainer 'RubyGems.org ops team'

version '0.1.5'
version '0.1.6'

depends 'chef-vault'
depends 'collectd'
9 changes: 6 additions & 3 deletions cookbooks/rubygems-metrics/recipes/postgresql.rb
Original file line number Diff line number Diff line change
@@ -3,8 +3,11 @@
# Recipe:: postgresql
#

include_recipe 'chef-vault'

dbhostname = data_bag_item('hosts', 'database')['environments'][node.chef_environment]
db_host = search(:node, "name:#{dbhostname}.#{node.chef_environment}.rubygems.org")[0]
credentials = chef_vault_item('postgresql', 'datadog')

template '/etc/collectd/plugins/postgresql.conf' do
owner 'root'
@@ -20,9 +23,9 @@
node.default['datadog']['postgres']['instances'] = [
{
'server' => 'localhost',
'username' => 'postgres',
'password' => db_host['postgresql']['password']['postgres'],
'tags' => []
'username' => credentials['username'],
'password' => credentials['password'],
'tags' => [node.chef_environment]
}
]