Fix folder duplicate checks

A folder may be exported to multiple clients/ranges.
This patch ensures the folder existence is checked only once.

Besides, the strip function is useless, split does strip strings

Signed-off-by: David Rozé <droze@baylibre.com>
This commit is contained in:
David Rozé 2024-02-22 18:21:04 +01:00
parent 799d43499e
commit 2b82deba45

View file

@ -18,9 +18,9 @@
- name: Ensure directories to export exist - name: Ensure directories to export exist
file: # noqa 208 file: # noqa 208
path: "{{ item.strip().split()[0] }}" path: "{{ item }}"
state: directory state: directory
with_items: "{{ nfs_exports }}" with_items: "{{ nfs_exports | map('split') | map('first') | unique }}"
- name: Copy exports file. - name: Copy exports file.
template: template: