passwords = data_bag_item("prometheus", "passwords")
tokens = data_bag_item("prometheus", "tokens")
+admins = data_bag_item("apache", "admins")
prometheus_exporter "fastly" do
port 8080
apache_site "prometheus.openstreetmap.org" do
template "apache.erb"
+ variables :admin_hosts => admins["hosts"]
end
template "/etc/cron.daily/prometheus-backup" do
ProxyPass /alertmanager http://localhost:9093/alertmanager
ProxyPass / http://localhost:3000/
ProxyPreserveHost on
+
+ <Location /alertmanager>
+<% @admin_hosts.each do |host| -%>
+ Require ip <%= host %>
+<% end -%>
+ </Location>
</VirtualHost>