diff --git a/cookbooks/prometheus-exporters/exporter_proxy.rb b/cookbooks/prometheus-exporters/exporter_proxy.rb index 8a2865f..9893c30 100644 --- a/cookbooks/prometheus-exporters/exporter_proxy.rb +++ b/cookbooks/prometheus-exporters/exporter_proxy.rb @@ -39,6 +39,19 @@ service 'exporter_proxy' do action [:enable, :start] end +remote_file '/etc/consul.d/service-exporter_proxy.json' do + user 'root' + group 'root' + + mode '644' + + notifies :restart, 'service[consul]' +end + +service 'consul' do + action :nothing +end + # Firewall settings here: %w( 60000/tcp ).each do |p| execute "ufw allow #{p}" do diff --git a/cookbooks/prometheus-exporters/files/etc/consul.d/service-exporter_proxy.json b/cookbooks/prometheus-exporters/files/etc/consul.d/service-exporter_proxy.json new file mode 100644 index 0000000..f1bbed4 --- /dev/null +++ b/cookbooks/prometheus-exporters/files/etc/consul.d/service-exporter_proxy.json @@ -0,0 +1,14 @@ +{ + "service": { + "name": "exporter_proxy", + "port": 60000, + "check":{ + "http": "http://localhost:60000/", + "tls_skip_verify": false, + "interval": "60s", + "timeout": "1s", + "status": "passing", + "success_before_passing": 3 + } + } +}