]> git.openstreetmap.org Git - chef.git/commitdiff
Allow path accessibility to be configured for systemd services
authorTom Hughes <tom@compton.nu>
Thu, 20 Aug 2020 07:32:35 +0000 (08:32 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 20 Aug 2020 07:32:35 +0000 (08:32 +0100)
cookbooks/systemd/resources/service.rb
cookbooks/systemd/templates/default/service.erb

index 9db776470c8d6c56805adf5500563ec8be302596..26cce29787447d617fe5d58c3382b72efb23a04b 100644 (file)
@@ -57,6 +57,9 @@ property :private_devices, [true, false]
 property :private_network, [true, false]
 property :protect_system, [TrueClass, FalseClass, String]
 property :protect_home, [TrueClass, FalseClass, String]
+property :read_write_paths, [String, Array]
+property :read_only_paths, [String, Array]
+property :inaccessible_paths, [String, Array]
 property :restrict_address_families, [String, Array]
 property :no_new_privileges, [true, false]
 property :tasks_max, Integer
index 4828c96af6dd898da6ccad9821bd802ce545720c..6d8a603cc0c01a92c84f71dab81794ecacaedafd 100644 (file)
@@ -108,6 +108,15 @@ ProtectSystem=<%= @protect_system %>
 <% if @protect_home -%>
 ProtectHome=<%= @protect_home %>
 <% end -%>
+<% if @read_write_paths -%>
+ReadWritePaths=<%= Array(@read_write_paths).join(" ") %>
+<% end -%>
+<% if @read_only_paths -%>
+ReadOnlyPaths=<%= Array(@read_only_paths).join(" ") %>
+<% end -%>
+<% if @inaccessible_paths -%>
+InaccessiblePaths=<%= Array(@inaccessible_paths).join(" ") %>
+<% end -%>
 <% if @restrict_address_families -%>
 RestrictAddressFamilies=<%= Array(@restrict_address_families).join(" ") %>
 <% end -%>