diff --git a/attributes/default.rb b/attributes/default.rb index ecdebc486..0169766bb 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -17,8 +17,6 @@ # limitations under the License. # -::Chef::Node::Attribute.send(:include, Opscode::OpenSSL::Password) - case platform when "debian" @@ -72,7 +70,3 @@ default[:postgresql][:version] = "8.4" set[:postgresql][:dir] = "/etc/postgresql/#{node[:postgresql][:version]}/main" end - -# generate all passwords -default[:postgresql][:password][:postgres] = secure_password - diff --git a/recipes/server.rb b/recipes/server.rb index bf78cd16f..13daba8e3 100644 --- a/recipes/server.rb +++ b/recipes/server.rb @@ -19,8 +19,13 @@ # limitations under the License. # +::Chef::Recipe.send(:include, Opscode::OpenSSL::Password) + include_recipe "postgresql::client" +# randomly generate postgres password +default[:postgresql][:password][:postgres] = secure_password + case node[:postgresql][:version] when "8.3" node.default[:postgresql][:ssl] = "off"