X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/2a67fe15cfd49735c38c944cf84481de6d126c6a..41c12d39c2b042bc631108181de77a162a799d13:/cookbooks/prometheus/resources/collector.rb diff --git a/cookbooks/prometheus/resources/collector.rb b/cookbooks/prometheus/resources/collector.rb index dc9c995a0..e82984b14 100644 --- a/cookbooks/prometheus/resources/collector.rb +++ b/cookbooks/prometheus/resources/collector.rb @@ -17,6 +17,8 @@ # limitations under the License. # +unified_mode true + default_action :create property :collector, :kind_of => String, :name_property => true @@ -36,7 +38,7 @@ action :create do private_tmp true protect_system "strict" protect_home true - read_write_paths "/var/lib/prometheus/node-exporter" + read_write_paths ["/var/lib/prometheus/node-exporter", "/var/lock", "/var/log"] no_new_privileges true end @@ -64,6 +66,10 @@ action :delete do systemd_service service_name do action :delete end + + file "/var/lib/prometheus/node-exporter/#{new_resource.collector}.prom" do + action :delete + end end action_class do @@ -72,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