include_recipe "apt::grafana"
include_recipe "awscli"
include_recipe "networking"
+include_recipe "tools"
passwords = data_bag_item("prometheus", "passwords")
tokens = data_bag_item("prometheus", "tokens")
variables :passwords => passwords
end
+systemd_service "grafana-server-wait-for-port" do
+ service "grafana-server"
+ dropin "wait-for-port"
+ exec_start_post "/usr/local/bin/wait-for-port 3000"
+end
+
service "grafana-server" do
action [:enable, :start]
subscribes :restart, "template[/etc/grafana/grafana.ini]"
supports :status => true, :restart => true, :reload => true
end
+# Install some common tools
+remote_directory "/usr/local/bin" do
+ source "local-bin"
+ owner "root"
+ group "root"
+ mode "755"
+ files_owner "root"
+ files_group "root"
+ files_mode "755"
+end
+
# Remove some unused and unwanted packages
package %w[mlocate whoopsie] do
action :purge