Merge pull request 'Fix PostgreSQL replica config with encrypted data directory' (#179) from bugfix/postgres_issues into master
This commit is contained in:
commit
81403b7cb9
@ -12,16 +12,18 @@
|
||||
"hostname": "centaurus",
|
||||
"ipaddress": "78.46.59.98",
|
||||
"roles": [
|
||||
"postgresql_replica",
|
||||
"gitea"
|
||||
"gitea",
|
||||
"postgresql_replica"
|
||||
],
|
||||
"recipes": [
|
||||
"kosmos-base",
|
||||
"kosmos-base::default",
|
||||
"kosmos-postgresql::replica",
|
||||
"kosmos_encfs",
|
||||
"kosmos_encfs::default",
|
||||
"kosmos_gitea",
|
||||
"kosmos_gitea::default",
|
||||
"kosmos_gitea::backup",
|
||||
"kosmos-postgresql::replica",
|
||||
"apt::default",
|
||||
"timezone_iii::default",
|
||||
"timezone_iii::debian",
|
||||
@ -35,8 +37,6 @@
|
||||
"postfix::_attributes",
|
||||
"postfix::sasl_auth",
|
||||
"hostname::default",
|
||||
"firewall::default",
|
||||
"chef-sugar::default",
|
||||
"kosmos-nginx::default",
|
||||
"nginx::default",
|
||||
"nginx::package",
|
||||
@ -46,10 +46,12 @@
|
||||
"nginx::commons_dir",
|
||||
"nginx::commons_script",
|
||||
"nginx::commons_conf",
|
||||
"firewall::default",
|
||||
"chef-sugar::default",
|
||||
"backup::default",
|
||||
"logrotate::default",
|
||||
"build-essential::default",
|
||||
"kosmos-base::letsencrypt"
|
||||
"kosmos-base::letsencrypt",
|
||||
"build-essential::default"
|
||||
],
|
||||
"platform": "ubuntu",
|
||||
"platform_version": "18.04",
|
||||
@ -67,7 +69,8 @@
|
||||
},
|
||||
"run_list": [
|
||||
"recipe[kosmos-base]",
|
||||
"role[postgresql_replica]",
|
||||
"role[gitea]"
|
||||
"recipe[kosmos_encfs]",
|
||||
"role[gitea]",
|
||||
"role[postgresql_replica]"
|
||||
]
|
||||
}
|
@ -33,7 +33,6 @@ end
|
||||
|
||||
service postgresql_service do
|
||||
supports restart: true, status: true, reload: true
|
||||
action [:enable]
|
||||
end
|
||||
|
||||
postgresql_data_bag_item = data_bag_item('credentials', 'postgresql')
|
||||
@ -41,7 +40,7 @@ postgresql_data_bag_item = data_bag_item('credentials', 'postgresql')
|
||||
primary = postgresql_primary
|
||||
|
||||
unless primary.nil?
|
||||
postgresql_data_dir = "/var/lib/postgresql/#{postgresql_version}/main"
|
||||
postgresql_data_dir = "#{node["kosmos_encfs"]["data_directory"]}/postgresql/#{postgresql_version}/main"
|
||||
|
||||
if node['kosmos-postgresql']['ready_to_set_up_replica']
|
||||
execute "set up replication" do
|
||||
|
@ -64,8 +64,7 @@ action :create do
|
||||
unix_socket_directories: "/var/run/postgresql",
|
||||
dynamic_shared_memory_type: "posix",
|
||||
timezone: "UTC", # default is GMT
|
||||
listen_addresses: "0.0.0.0",
|
||||
data_directory: postgresql_data_dir
|
||||
listen_addresses: "0.0.0.0"
|
||||
}
|
||||
|
||||
if new_resource.role == "replica"
|
||||
@ -101,6 +100,7 @@ action :create do
|
||||
|
||||
postgresql_server_conf "main" do
|
||||
version postgresql_version
|
||||
data_directory postgresql_data_dir
|
||||
additional_config additional_config
|
||||
notifies :reload, "service[#{postgresql_service}]", :delayed
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user