Switch ejabberd, mastodon and gitea to a hostname for Postgres

This commit is contained in:
Greg Karékinian
2021-01-23 16:43:15 +01:00
parent fdd70d1872
commit bb0e73d1b9
3 changed files with 4 additions and 16 deletions

View File

@@ -21,10 +21,6 @@ end
elasticsearch_service 'elasticsearch'
postgresql_data_bag_item = data_bag_item('credentials', 'postgresql')
postgresql_primary_node = postgresql_primary
postgresql_server = postgresql_primary_node[:ipaddress]
# PostgreSQL is on the same server, connect through localhost
postgresql_server = "localhost" if postgresql_primary_node[:hostname] == node[:hostname]
mastodon_path = node["kosmos-mastodon"]["directory"]
@@ -138,7 +134,8 @@ application mastodon_path do
vapid_private_key: mastodon_credentials['vapid_private_key'],
vapid_public_key: mastodon_credentials['vapid_public_key'],
db_pass: postgresql_data_bag_item['mastodon_user_password'],
db_host: postgresql_server
db_host: "pg.kosmos.local"
notifies :restart, "application[#{mastodon_path}]", :delayed
end
execute "bundle install" do