From da476aeb6d365769de4956796b25255086d94cb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 18 Aug 2018 19:45:20 +0200 Subject: Group hosts in single export line --- modules/role/templates/file_store/nfs_clients.erb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 modules/role/templates/file_store/nfs_clients.erb (limited to 'modules/role/templates') diff --git a/modules/role/templates/file_store/nfs_clients.erb b/modules/role/templates/file_store/nfs_clients.erb new file mode 100644 index 0000000..0d8a295 --- /dev/null +++ b/modules/role/templates/file_store/nfs_clients.erb @@ -0,0 +1,12 @@ +<%= @hosts.flat_map do |host_cn, config| + host = scope.function_find_host([@facts["ldapvar"]["other"], host_cn]) + if host.nil? + [host_cn] + elsif !host["vars"]["wireguard_ip"].nil? + host["vars"]["wireguard_ip"] + elsif !host["vars"]["host"].nil? + host["vars"]["host"] + else + host["vars"]["real_hostname"] + end.map { |h| h + config } +end.join(" ") -%> -- cgit v1.2.3