X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/1a9c5988c4a147614cef029abb4a31e42acecb47..18db4c72edea0d2cd4df5b7d7d9011df618d0ff9:/cookbooks/community/recipes/default.rb?ds=sidebyside diff --git a/cookbooks/community/recipes/default.rb b/cookbooks/community/recipes/default.rb index bd6f7d27a..224cb975d 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] @@ -42,10 +46,24 @@ directory "/srv/community.openstreetmap.org/shared" do mode "755" end +directory "/srv/community.openstreetmap.org/files" do + owner "community" + group "community" + mode "755" +end + +template "/srv/community.openstreetmap.org/files/update-feeds.atom" do + source "update-feeds.atom.erb" + owner "community" + group "community" + mode "644" +end + git "/srv/community.openstreetmap.org/docker" do action :sync repository "https://github.com/discourse/discourse_docker.git" - revision "13bfcd2517c743e1bc313b8d89631772702ae112" + # Revision pin not possible as launch wrapper automatically updates git repo. + revision "main" depth 1 user "root" group "root" @@ -68,7 +86,8 @@ template "/srv/community.openstreetmap.org/docker/containers/web_only.yml" do owner "root" group "root" mode "640" - variables :license_keys => license_keys, :passwords => passwords + variables :license_keys => license_keys, :passwords => passwords, + :prometheus_servers => prometheus_servers notifies :run, "notify_group[discourse_container_new_web_only]" end @@ -82,7 +101,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