X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/ebf6894fad08763e1dd79383934422ea919beb69..794cc957324de66edab45373053be3e601090f1f:/cookbooks/community/recipes/default.rb diff --git a/cookbooks/community/recipes/default.rb b/cookbooks/community/recipes/default.rb index 98dea4836..000a57a7e 100644 --- a/cookbooks/community/recipes/default.rb +++ b/cookbooks/community/recipes/default.rb @@ -25,6 +25,10 @@ include_recipe "ssl" passwords = data_bag_item("community", "passwords") license_keys = data_bag_item("geoipupdate", "license-keys") unless kitchen? +prometheus_servers = search(:node, "recipes:prometheus\\:\\:server").map do |server| + server.ipaddresses(:role => :external) +end.flatten + # Disable any default installed apache2 service. Web server is embedded within the discourse docker container service "apache2" do action [:disable, :stop] @@ -77,15 +81,28 @@ template "/srv/community.openstreetmap.org/docker/containers/data.yml" do notifies :run, "notify_group[discourse_container_new_data]" end +resolvers = node[:networking][:nameservers].map do |resolver| + resolver =~ /:/ ? "[#{resolver}]" : resolver +end + template "/srv/community.openstreetmap.org/docker/containers/web_only.yml" do source "web_only.yml.erb" owner "root" group "root" mode "640" - variables :license_keys => license_keys, :passwords => passwords + variables :license_keys => license_keys, :passwords => passwords, + :prometheus_servers => prometheus_servers, :resolvers => resolvers notifies :run, "notify_group[discourse_container_new_web_only]" end +template "/srv/community.openstreetmap.org/files/policyd-spf.conf" do + source "policyd-spf.conf.erb" + owner "community" + group "community" + mode "644" + notifies :run, "notify_group[discourse_container_new_mail_receiver]" +end + template "/srv/community.openstreetmap.org/docker/containers/mail-receiver.yml" do source "mail-receiver.yml.erb" owner "root" @@ -96,7 +113,7 @@ template "/srv/community.openstreetmap.org/docker/containers/mail-receiver.yml" end ssl_certificate "community.openstreetmap.org" do - domains ["community.openstreetmap.org", "community.osm.org", "communities.openstreetmap.org", "communities.osm.org", "c.openstreetmap.org", "c.osm.org"] + domains ["community.openstreetmap.org", "community.osm.org", "communities.openstreetmap.org", "communities.osm.org", "c.openstreetmap.org", "c.osm.org", "forum.openstreetmap.org", "forum.osm.org"] notifies :run, "notify_group[discourse_container_new_web_only]" notifies :run, "notify_group[discourse_container_new_mail_receiver]" end