]> git.openstreetmap.org Git - chef.git/commitdiff
Make sure rsyncd can write to paths it needs to
authorTom Hughes <tom@compton.nu>
Mon, 4 Jul 2022 19:25:56 +0000 (20:25 +0100)
committerTom Hughes <tom@compton.nu>
Mon, 4 Jul 2022 19:27:09 +0000 (20:27 +0100)
cookbooks/rsyncd/recipes/default.rb

index a2edd32faf14262009b2448f4136000adc670036..0946a0c19f1f9fcf9a38a34e2b0b62db4582802f 100644 (file)
 
 include_recipe "networking"
 
+writable_paths = []
 hosts_allow = {}
 hosts_deny = {}
 
 node[:rsyncd][:modules].each do |name, details|
+  writable_paths << details[:path] if details[:write_only]
+
   hosts_allow[name] = details[:hosts_allow] || []
 
   if details[:nodes_allow]
@@ -46,6 +49,7 @@ systemd_service "rsync-override" do
   service "rsync"
   dropin "override"
   exec_start "/usr/bin/rsync --daemon --no-detach --bwlimit=16384"
+  read_write_paths writable_paths.sort
   notifies :restart, "service[rsync]"
 end