2019-03-03 08:50:49 +00:00
|
|
|
# Start/Enable `grafana`:
|
|
|
|
service 'grafana-server' do
|
|
|
|
action [ :enable, :start ]
|
|
|
|
end
|
|
|
|
|
2020-09-26 08:34:59 +00:00
|
|
|
# Deploy `consul` config for `grafana`:
|
|
|
|
remote_file '/etc/consul.d/service-grafana.json' do
|
|
|
|
owner 'root'
|
|
|
|
group 'root'
|
|
|
|
mode '644'
|
|
|
|
|
|
|
|
notifies :restart, 'service[supervisor]'
|
|
|
|
end
|
|
|
|
|
2019-03-03 08:50:49 +00:00
|
|
|
# Firewall settings here:
|
|
|
|
%w( 3000/tcp ).each do |p|
|
|
|
|
execute "ufw allow #{p}" do
|
|
|
|
user 'root'
|
|
|
|
|
|
|
|
not_if "LANG=c ufw status | grep #{p}"
|
|
|
|
|
|
|
|
notifies :run, 'execute[ufw reload-or-enable]'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
execute 'ufw reload-or-enable' do
|
|
|
|
user 'root'
|
|
|
|
command 'LANG=C ufw reload | grep skipping && ufw --force enable || exit 0'
|
|
|
|
|
|
|
|
action :nothing
|
|
|
|
end
|