Skip to content

Commit

Permalink
Use boolean values for ssl. Remove duplicated code.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisroberts authored and jtimberman committed Nov 9, 2012
1 parent 1e26521 commit b223d2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
9 changes: 5 additions & 4 deletions recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
node.set_unless['postgresql']['password']['postgres'] = secure_password
node.save unless Chef::Config[:solo]

if node['postgresql']['version'].to_f <= 8.3
node.default['postgresql']['ssl'] = "off"
else
node.default['postgresql']['ssl'] = "true"
case node[:postgresql][:version]
when "8.3"
node.default[:postgresql][:ssl] = false
when "8.4"
node.default[:postgresql][:ssl] = true
end

# Include the right "family" recipe for installing the server
Expand Down
7 changes: 0 additions & 7 deletions recipes/server_debian.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@

include_recipe "postgresql::client"


if node['postgresql']['version'].to_f <= 8.3
node.default['postgresql']['ssl'] = "off"
else
node.default['postgresql']['ssl'] = "true"
end

node['postgresql']['server']['packages'].each do |pg_pack|
package pg_pack do
action :install
Expand Down

0 comments on commit b223d2a

Please sign in to comment.