]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/prometheus/resources/collector.rb
Fix resource attribute name
[chef.git] / cookbooks / prometheus / resources / collector.rb
index dc9c995a047a1304dfc87416d5e65506d11bd196..e82984b143354b45326bb12d47eb71c51d1fed8b 100644 (file)
@@ -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