From: Tom Hughes Date: Wed, 17 Nov 2021 18:46:03 +0000 (+0000) Subject: Move exporters to /opt/prometheus-exporters X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/4848413b102b4643b0dbec409f0a45dd83cfc07f Move exporters to /opt/prometheus-exporters --- diff --git a/cookbooks/prometheus/recipes/default.rb b/cookbooks/prometheus/recipes/default.rb index 85c5ec312..21200b8e9 100644 --- a/cookbooks/prometheus/recipes/default.rb +++ b/cookbooks/prometheus/recipes/default.rb @@ -43,14 +43,10 @@ end directory "/opt/prometheus" do action :delete - owner "root" - group "root" - mode "755" recursive true - not_if { ::Dir.exist?("/opt/prometheus/.git") } end -git "/opt/prometheus" do +git "/opt/prometheus-exporters" do action :sync repository "https://github.com/openstreetmap/prometheus-exporters.git" revision "main" @@ -117,7 +113,7 @@ end unless node[:prometheus][:snmp].empty? prometheus_exporter "snmp" do port 9116 - options "--config.file=/opt/prometheus/exporters/snmp/snmp.yml" + options "--config.file=/opt/prometheus-exporters/exporters/snmp/snmp.yml" register_target false end end diff --git a/cookbooks/prometheus/resources/collector.rb b/cookbooks/prometheus/resources/collector.rb index 4a0c22d9b..ef103c3c0 100644 --- a/cookbooks/prometheus/resources/collector.rb +++ b/cookbooks/prometheus/resources/collector.rb @@ -78,7 +78,7 @@ action_class do end def executable_path - "/opt/prometheus/collectors/#{new_resource.collector}/#{new_resource.collector}_collector" + "/opt/prometheus-exporters/collectors/#{new_resource.collector}/#{new_resource.collector}_collector" end def executable_options diff --git a/cookbooks/prometheus/resources/exporter.rb b/cookbooks/prometheus/resources/exporter.rb index ae0596885..2a22198df 100644 --- a/cookbooks/prometheus/resources/exporter.rb +++ b/cookbooks/prometheus/resources/exporter.rb @@ -103,7 +103,7 @@ action_class do end def executable_path - "/opt/prometheus/exporters/#{new_resource.exporter}/#{new_resource.exporter}_exporter" + "/opt/prometheus-exporters/exporters/#{new_resource.exporter}/#{new_resource.exporter}_exporter" end def executable_options @@ -129,5 +129,5 @@ action_class do end def after_created - subscribes :restart, "git[/opt/prometheus]" + subscribes :restart, "git[/opt/prometheus-exporters]" end