Skip to content

Commit

Permalink
Merge pull request #347 from hw-cookbooks/develop
Browse files Browse the repository at this point in the history
Postgresql 4.0.4
  • Loading branch information
agoddard committed Mar 23, 2016
2 parents c2aae04 + 5155cb2 commit 86eee2d
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 13 deletions.
22 changes: 14 additions & 8 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
driver_plugin: vagrant

platforms:
- name: ubuntu-15.04
run_list:
- recipe[apt]

- name: ubuntu-14.04
run_list:
- recipe[apt]
Expand All @@ -14,6 +18,8 @@ platforms:
run_list:
- recipe[apt]

- name: centos-7.2

- name: centos-7.0

- name: centos-6.4
Expand Down Expand Up @@ -47,7 +53,7 @@ suites:
run_list:
- recipe[minitest-handler]
- recipe[postgresql]
excludes: [ "centos-6.4", "centos-7.0", "opensuse-13.1", "opensuse-13.2" ]
excludes: [ "centos-6.4", "centos-7.0", "centos-7.2", "opensuse-13.1", "opensuse-13.2" ]
attributes:
postgresql:
enable_pgdg_apt: true
Expand All @@ -59,7 +65,7 @@ suites:
run_list:
- recipe[minitest-handler]
- recipe[postgresql]
excludes: [ "ubuntu-12.04", "ubuntu-14.04", "debian-8.2", "opensuse-13.1", "opensuse-13.2" ]
excludes: [ "ubuntu-12.04", "ubuntu-14.04", "ubuntu-15.04", "debian-8.2", "opensuse-13.1", "opensuse-13.2" ]
attributes:
postgresql:
enable_pgdg_yum: true
Expand Down Expand Up @@ -89,7 +95,7 @@ suites:
- recipe[minitest-handler]
- recipe[postgresql::ruby]
- recipe[postgresql::server]
excludes: [ "centos-6.4", "centos-7.0", "opensuse-13.1", "opensuse-13.2" ]
excludes: [ "centos-6.4", "centos-7.0", "centos-7.2", "opensuse-13.1", "opensuse-13.2" ]
attributes:
postgresql:
enable_pgdg_apt: true
Expand All @@ -111,7 +117,7 @@ suites:
- recipe[minitest-handler]
- recipe[postgresql::ruby]
- recipe[postgresql::server]
excludes: [ "ubuntu-12.04", "ubuntu-14.04", "debian-8.2", "opensuse-13.1", "opensuse-13.2" ]
excludes: [ "ubuntu-12.04", "ubuntu-14.04", "ubuntu-15.04", "debian-8.2", "opensuse-13.1", "opensuse-13.2" ]
attributes:
postgresql:
enable_pgdg_yum: true
Expand All @@ -130,7 +136,7 @@ suites:
- recipe[minitest-handler]
- recipe[postgresql]
- recipe[postgresql::ruby]
excludes: [ "centos-6.4", "centos-7.0", "opensuse-13.1", "opensuse-13.2" ]
excludes: [ "centos-6.4", "centos-7.0", "centos-7.2", "opensuse-13.1", "opensuse-13.2" ]
attributes:
postgresql:
enable_pgdg_apt: true
Expand All @@ -143,7 +149,7 @@ suites:
- recipe[minitest-handler]
- recipe[postgresql]
- recipe[postgresql::ruby]
excludes: [ "ubuntu-12.04", "ubuntu-14.04", "debian-8.2", "opensuse-13.1", "opensuse-13.2" ]
excludes: [ "ubuntu-12.04", "ubuntu-14.04", "ubuntu-15.04", "debian-8.2", "opensuse-13.1", "opensuse-13.2" ]
attributes:
postgresql:
enable_pgdg_yum: true
Expand All @@ -156,7 +162,7 @@ suites:
- recipe[minitest-handler]
- recipe[postgresql::ruby]
- recipe[postgresql::contrib]
excludes: [ "centos-6.4", "centos-7.0", "opensuse-13.1", "opensuse-13.2" ]
excludes: [ "centos-6.4", "centos-7.0", "centos-7.2", "opensuse-13.1", "opensuse-13.2" ]
attributes:
postgresql:
enable_pgdg_apt: true
Expand All @@ -182,7 +188,7 @@ suites:
- recipe[minitest-handler]
- recipe[postgresql::ruby]
- recipe[postgresql::contrib]
excludes: [ "ubuntu-12.04", "ubuntu-14.04", "debian-8.2", "opensuse-13.1", "opensuse-13.2" ]
excludes: [ "ubuntu-12.04", "ubuntu-14.04", "ubuntu-15.04", "debian-8.2", "opensuse-13.1", "opensuse-13.2" ]
attributes:
postgresql:
enable_pgdg_yum: true
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ postgresql Cookbook CHANGELOG
=============================
This file is used to list changes made in each version of the postgresql cookbook.

v4.0.4
-----
* Add leading pound symbol on pg_hba.conf template comment line
* Update gem install for compile_time to correct deprication warning
* Add support Ubuntu Wily Werewolf pgdg apt repository
* test-kitchen platforms for Centos 7.2 and Ubuntu 15.04
* Fixes PostgreSQL version & package name defaults for EL7 distros
* Add appropriate systemd unit file overrides for EL7 distros

v4.0.2
-----
* Add Code of Conduct
Expand Down
7 changes: 7 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,13 @@
default['postgresql']['contrib']['packages'] = ['postgresql-contrib']
end

if node['platform_version'].to_f >= 7.0
default['postgresql']['version'] = '9.2'
default['postgresql']['client']['packages'] = ['postgresql-devel']
default['postgresql']['server']['packages'] = ['postgresql-server']
default['postgresql']['contrib']['packages'] = ['postgresql-contrib']
end

when "opensuse"

default['postgresql']['dir'] = "/var/lib/pgsql/data"
Expand Down
6 changes: 4 additions & 2 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
license "Apache 2.0"
description "Installs and configures postgresql for clients or servers"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "4.0.2"
version "4.0.4"
source_url "https://github.com/hw-cookbooks/postgresql" if respond_to?(:source_url)
issues_url "https://github.com/hw-cookbooks/postgresql/issues" if respond_to?(:issues_url)
recipe "postgresql", "Includes postgresql::client"
recipe "postgresql::ruby", "Installs pg gem for Ruby bindings"
recipe "postgresql::client", "Installs postgresql client package(s)"
recipe "postgresql::server", "Installs postgresql server packages, templates"
recipe "postgresql::server_redhat", "Installs postgresql server packages, redhat family style"
recipe "postgresql::server_debian", "Installs postgresql server packages, debian family style"

supports "ubuntu", "< 14.10"
supports "ubuntu", "<= 15.10"

%w{debian fedora suse opensuse amazon}.each do |os|
supports os
Expand Down
2 changes: 1 addition & 1 deletion recipes/apt_pgdg_postgresql.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if not %w(jessie squeeze wheezy sid lucid precise saucy trusty utopic).include? node['postgresql']['pgdg']['release_apt_codename']
if not %w(jessie squeeze wheezy sid lucid precise saucy trusty utopic wily).include? node['postgresql']['pgdg']['release_apt_codename']
raise "Not supported release by PGDG apt repository"
end

Expand Down
4 changes: 3 additions & 1 deletion recipes/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@
end

begin
chef_gem "pg"
chef_gem "pg" do
compile_time true if respond_to?(:compile_time)
end
rescue Gem::Installer::ExtensionBuildError, Mixlib::ShellOut::ShellCommandFailed => e
# Are we an omnibus install?
raise if RbConfig.ruby.scan(%r{(chef|opscode)}).empty?
Expand Down
15 changes: 15 additions & 0 deletions recipes/server_redhat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@

if node['postgresql']['server']['init_package'] == 'systemd'

if node['platform_family'] == 'rhel'
template '/etc/systemd/system/postgresql.service' do
source 'postgresql.service.erb'
owner 'root'
group 'root'
mode '0644'
notifies :run, 'execute[systemctl-reload]', :immediately
notifies :reload, 'service[postgresql]', :delayed
end
execute 'systemctl-reload' do
command 'systemctl daemon-reload'
action :nothing
end
end

case node['platform_family']
when 'suse'
execute "initdb -d #{node['postgresql']['dir']}" do
Expand Down
2 changes: 1 addition & 1 deletion templates/default/pg_hba.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<% node['postgresql']['pg_hba'].each do |auth| -%>
<% if auth[:comment] %>
<%= auth[:comment] %>
# <%= auth[:comment] %>
<% end %>
<% if auth[:addr] %>
<%= auth[:type].ljust(7) %> <%= auth[:db].ljust(15) %> <%= auth[:user].ljust(15) %> <%= auth[:addr].ljust(23) %> <%= auth[:method] %>
Expand Down
5 changes: 5 additions & 0 deletions templates/default/postgresql.service.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.include /usr/lib/systemd/system/postgresql.service
[Service]
Environment=
Environment=PGPORT=<%= node['postgresql']['config']['port'] %>
Environment=PGDATA=<%= node['postgresql']['config']['data_directory'] %>

0 comments on commit 86eee2d

Please sign in to comment.