Finish initial encfs cookbook and postgres adaptations
This commit is contained in:
@@ -4,19 +4,19 @@ property :postgresql_version, String, required: true, name_property: true
|
||||
property :role, String, required: true # Can be primary or replica
|
||||
|
||||
action :create do
|
||||
encfs_data_dir = node["kosmos_encfs"]["data_directory"]
|
||||
postgresql_version = new_resource.postgresql_version
|
||||
postgresql_data_dir = "/mnt/data/postgresql/#{postgresql_version}/main"
|
||||
postgresql_data_dir = "#{encfs_data_dir}/postgresql/#{postgresql_version}/main"
|
||||
postgresql_service = "postgresql@#{postgresql_version}-main"
|
||||
|
||||
node.override['build-essential']['compile_time'] = true
|
||||
include_recipe 'build-essential::default'
|
||||
|
||||
# TODO should likely go in the encfs cookbook somewhere
|
||||
directory "/mnt/data" do
|
||||
mode "0755"
|
||||
user "postgres" do
|
||||
manage_home false
|
||||
end
|
||||
|
||||
directory "/mnt/data/postgresql" do
|
||||
directory "#{encfs_data_dir}/postgresql" do
|
||||
owner "postgres"
|
||||
group "postgres"
|
||||
mode "0750"
|
||||
@@ -43,6 +43,9 @@ action :create do
|
||||
action :start
|
||||
end
|
||||
|
||||
# Activates the postgres service when encrypted data dir is mounted
|
||||
encfs_path_activation_unit postgresql_service
|
||||
|
||||
# This service is a dependency that will auto-start our cluster service on
|
||||
# boot if it's enabled, so we disable it explicitly
|
||||
service "postgresql" do
|
||||
|
||||
Reference in New Issue
Block a user