Merge pull request 'Add PostgreSQL primary support to the kosmos-ejabberd cookbook' (#181) from feature/180-ejabberd_pg_primary into master

This commit was merged in pull request #181.
This commit is contained in:
2020-06-19 14:46:52 +00:00
8 changed files with 103 additions and 46 deletions

View File

@@ -6,12 +6,6 @@
gitea_data_bag_item = data_bag_item("credentials", "gitea")
postgresql_service = "service[#{postgresql_service_name}]"
service postgresql_service do
supports restart: true, status: true, reload: true
end
postgresql_user "gitea" do
action :create
password gitea_data_bag_item["postgresql_password"]
@@ -21,17 +15,3 @@ postgresql_database "gitea" do
owner "gitea"
action :create
end
search(:node, "role:gitea AND chef_environment:#{node.chef_environment}").each do |gitea_server|
ip = ip_for(gitea_server)
hostname = gitea_server[:hostname]
postgresql_access "gitea #{hostname}" do
access_type "host"
access_db "gitea"
access_user "gitea"
access_addr "#{ip}/32"
access_method "md5"
notifies :reload, postgresql_service, :delayed
end
end