X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/5ace4fe37e3efcb81461114649967b8bc23976f8..226773e8e4b1b7e0141c45e0040fa2cd4141282a:/cookbooks/prometheus/resources/collector.rb diff --git a/cookbooks/prometheus/resources/collector.rb b/cookbooks/prometheus/resources/collector.rb index 1dfd8764d..ce68a7e5c 100644 --- a/cookbooks/prometheus/resources/collector.rb +++ b/cookbooks/prometheus/resources/collector.rb @@ -24,6 +24,7 @@ default_action :create property :collector, :kind_of => String, :name_property => true property :interval, :kind_of => [Integer, String], :required => [:create] property :user, :kind_of => String +property :path, :kind_of => String property :options, :kind_of => [String, Array] property :environment, :kind_of => Hash, :default => {} property :proc_subset, String @@ -36,6 +37,7 @@ property :protect_kernel_modules, [true, false] action :create do systemd_service service_name do description "Prometheus #{new_resource.collector} collector" + type "oneshot" user new_resource.user dynamic_user new_resource.user.nil? group "adm" @@ -90,7 +92,7 @@ action_class do end def executable_path - "/opt/prometheus-exporters/collectors/#{new_resource.collector}/#{new_resource.collector}_collector" + new_resource.path || "/opt/prometheus-exporters/collectors/#{new_resource.collector}/#{new_resource.collector}_collector" end def executable_options