Set postgresql password from an encrypted data bag

This commit is contained in:
Greg Karékinian
2019-03-13 17:38:24 +01:00
parent b82ccbb476
commit 87b3d3a9c5
2 changed files with 29 additions and 0 deletions

View File

@@ -4,9 +4,21 @@
#
# Copyright:: 2019, Kosmos, All Rights Reserved.
node.override['build-essential']['compile_time'] = true
include_recipe 'build-essential::default'
package("libpq-dev") { action :nothing }.run_action(:install)
chef_gem 'pg' do
compile_time true
end
postgresql_data_bag_item = data_bag_item('credentials', 'postgresql')
postgresql_server_install "main" do
version "10"
setup_repo false
password postgresql_data_bag_item['server_password']
action :install
end