Skip to content

Commit

Permalink
[COOK-3717] Pgdg repositories improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Sean OMeara <[email protected]>
  • Loading branch information
mnencia authored and Sean OMeara committed Nov 5, 2013
1 parent d0ae7ef commit 8a1dda3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 39 deletions.
39 changes: 20 additions & 19 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ platforms:
run_list:
- recipe[apt]

- name: debian-7.1.0
driver_config:
box: opscode-debian-7.1.0
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_debian-7.1.0_provisionerless.box
run_list:
- recipe[apt]

- name: centos-6.4
driver_config:
box: opscode-centos-6.4
Expand Down Expand Up @@ -51,21 +58,19 @@ suites:
attributes:
postgresql:
enable_pgdg_apt: true
version: "9.2"
client:
packages: ["postgresql-client-9.2", "libpq-dev"]
version: "9.3"

- name: yum-pgdg-client
run_list:
- recipe[minitest-handler]
- recipe[postgresql]
excludes: ["ubuntu-10.04", "ubuntu-12.04", "debian-6.0.7"]
excludes: ["ubuntu-10.04", "ubuntu-12.04", "debian-7.1.0"]
attributes:
postgresql:
enable_pgdg_yum: true
version: "9.2"
version: "9.3"
client:
packages: ["postgresql92"]
packages: ["postgresql93"]

- name: ruby
run_list:
Expand All @@ -92,9 +97,7 @@ suites:
attributes:
postgresql:
enable_pgdg_apt: true
version: "9.2"
server:
packages: ["postgresql-9.2"]
version: "9.3"
password:
postgres: "iloverandompasswordsbutthiswilldo"
config:
Expand All @@ -106,14 +109,14 @@ suites:
- recipe[minitest-handler]
- recipe[postgresql::ruby]
- recipe[postgresql::server]
excludes: ["ubuntu-10.04", "ubuntu-12.04", "debian-6.0.7"]
excludes: ["ubuntu-10.04", "ubuntu-12.04", "debian-7.1.0"]
attributes:
postgresql:
enable_pgdg_yum: true
version: "9.2"
version: "9.3"
server:
packages: ["postgresql92-server"]
service_name: "postgresql-9.2"
packages: ["postgresql93-server"]
service_name: "postgresql-9.3"
password:
postgres: "iloverandompasswordsbutthiswilldo"

Expand All @@ -126,19 +129,17 @@ suites:
attributes:
postgresql:
enable_pgdg_apt: true
version: "9.2"
client:
packages: ["postgresql-client-9.2", "libpq-dev"]
version: "9.3"

- name: yum-pgdg-client-ruby
run_list:
- recipe[minitest-handler]
- recipe[postgresql]
- recipe[postgresql::ruby]
excludes: ["ubuntu-10.04", "ubuntu-12.04", "debian-6.0.7"]
excludes: ["ubuntu-10.04", "ubuntu-12.04", "debian-7.1.0"]
attributes:
postgresql:
enable_pgdg_yum: true
version: "9.2"
version: "9.3"
client:
packages: ["postgresql92", "postgresql92-devel"]
packages: ["postgresql93", "postgresql93-devel"]
22 changes: 7 additions & 15 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
default['postgresql']['server']['service_name'] = "postgresql"
end

default['postgresql']['client']['packages'] = %w{postgresql-client libpq-dev}
default['postgresql']['server']['packages'] = %w{postgresql}
default['postgresql']['contrib']['packages'] = %w{postgresql-contrib}
default['postgresql']['client']['packages'] = ["postgresql-client-#{node['postgresql']['version']}","libpq-dev"]
default['postgresql']['server']['packages'] = ["postgresql-#{node['postgresql']['version']}"]
default['postgresql']['contrib']['packages'] = ["postgresql-contrib-#{node['postgresql']['version']}"]

when "ubuntu"

Expand All @@ -62,13 +62,9 @@
default['postgresql']['server']['service_name'] = "postgresql"
end

default['postgresql']['client']['packages'] = %w{postgresql-client libpq-dev}
if node['postgresql']['enable_pgdg_apt']
default['postgresql']['server']['packages'] = ["postgresql-#{node['postgresql']['version']}"]
else
default['postgresql']['server']['packages'] = %w{postgresql}
end
default['postgresql']['contrib']['packages'] = %w{postgresql-contrib}
default['postgresql']['client']['packages'] = ["postgresql-client-#{node['postgresql']['version']}","libpq-dev"]
default['postgresql']['server']['packages'] = ["postgresql-#{node['postgresql']['version']}"]
default['postgresql']['contrib']['packages'] = ["postgresql-contrib-#{node['postgresql']['version']}"]

when "fedora"

Expand Down Expand Up @@ -207,7 +203,7 @@
# access to the PGDG yum repositories. Links to RPMs for installation
# on the supported version/platform combinations are listed at
# http://yum.postgresql.org/repopackages.php, and the links for
# PostgreSQL 8.4, 9.0, 9.1 and 9.2 (from 2013-01-15) are captured below.
# PostgreSQL 8.4, 9.0, 9.1, 9.2 and 9.3 are captured below.
#
# The correct RPM for installing /etc/yum.repos.d is based on:
# * the attribute configuring the desired Postgres Software:
Expand Down Expand Up @@ -309,10 +305,6 @@
"16" => {
"i386" => "http://yum.postgresql.org/9.2/fedora/fedora-16-i386/pgdg-fedora92-9.2-5.noarch.rpm",
"x86_64" => "http://yum.postgresql.org/9.2/fedora/fedora-16-x86_64/pgdg-fedora92-9.2-5.noarch.rpm"
},
"15" => {
"i386" => "http://yum.postgresql.org/9.2/fedora/fedora-15-i386/pgdg-fedora92-9.2-5.noarch.rpm",
"x86_64" => "http://yum.postgresql.org/9.2/fedora/fedora-15-x86_64/pgdg-fedora92-9.2-5.noarch.rpm"
}
}
},
Expand Down
8 changes: 4 additions & 4 deletions files/default/tests/minitest/apt_pgdg_postgresql_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
file("/etc/apt/sources.list.d/apt.postgresql.org.list").must_exist
end

it 'installs postgresql-client-9.2' do
package("postgresql-client-9.2").must_be_installed
it 'installs postgresql-client-9.3' do
package("postgresql-client-9.3").must_be_installed
end

it 'makes psql version 9.2 available' do
it 'makes psql version 9.3 available' do
psql = shell_out("psql --version")
assert psql.stdout.include?("psql (PostgreSQL) 9.2")
assert psql.stdout.include?("psql (PostgreSQL) 9.3")
end
end
2 changes: 1 addition & 1 deletion recipes/apt_pgdg_postgresql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
apt_repository 'apt.postgresql.org' do
uri 'http://apt.postgresql.org/pub/repos/apt'
distribution "#{node['postgresql']['pgdg']['release_apt_codename']}-pgdg"
components %w(main)
components ['main', node['postgresql']['version']]
key 'http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc'
action :add
end

0 comments on commit 8a1dda3

Please sign in to comment.