+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]
+ hosts_allow[name] |= search(:node, details[:nodes_allow]).collect do |n|
+ n.ipaddresses(:role => :external)
+ end.flatten
+ end
+
+ hosts_deny[name] = details[:hosts_deny] || []
+
+ next unless details[:nodes_deny]
+
+ hosts_deny[name] |= search(:node, details[:nodes_deny]).collect do |n|
+ n.ipaddresses(:role => :external)
+ end.flatten
+end
+