Permalink
Browse files

fixes for debian/ubuntu postgres versions and startup script names

  • Loading branch information...
1 parent 15185b3 commit 9dc2f8d112fbb37e5ae0027ea633c101d3204e9e @lamont-granquist lamont-granquist committed Nov 14, 2011
Showing with 24 additions and 4 deletions.
  1. +5 −2 attributes/default.rb
  2. +19 −2 recipes/server_debian.rb
View
@@ -32,10 +32,13 @@
when "ubuntu"
- if platform_version.to_f <= 9.04
+ case
+ when platform_version.to_f <= 9.04
default[:postgresql][:version] = "8.3"
- else
+ when platform_version_to_f <= 11.04
default[:postgresql][:version] = "8.4"
+ else
+ default[:postgresql][:version] = "9.1"
end
set[:postgresql][:dir] = "/etc/postgresql/#{node[:postgresql][:version]}/main"
View
@@ -22,14 +22,31 @@
case node[:postgresql][:version]
when "8.3"
node.default[:postgresql][:ssl] = "off"
-when "8.4"
+else # > 8.3
node.default[:postgresql][:ssl] = "true"
end
package "postgresql"
service "postgresql" do
- service_name "postgresql-#{node.postgresql.version}"
+ case node['platform']
+ when "ubuntu"
+ case
+ when node['platform_version'].to_f <= 10.04
+ service_name "postgresql-#{node.postgresql.version}"
+ else
+ service_name "postgresql"
+ end
+ when "debian"
+ case
+ when platform_version.to_f <= 5.0
+ service_name "postgresql-#{node.postgresql.version}"
+ when platform_version =~ /.*sid/
+ service_name "postgresql"
+ else
+ service_name "postgresql"
+ end
+ end
supports :restart => true, :status => true, :reload => true
action :nothing
end

0 comments on commit 9dc2f8d

Please sign in to comment.