diff --git a/roles/common/templates/etc/systemd/system/systemd_automount.j2 b/roles/common/templates/etc/systemd/system/systemd_automount.j2 index 6b3faba..4747e43 100644 --- a/roles/common/templates/etc/systemd/system/systemd_automount.j2 +++ b/roles/common/templates/etc/systemd/system/systemd_automount.j2 @@ -6,6 +6,12 @@ Before={{ item.before }} {% if item.after is defined and item.after -%} After={{ item.after }} {% endif %} +{% if item.wants is defined and item.wants -%} +Wants={{ item.wants }} +{% endif %} +{% if item.requires is defined and item.requires -%} +Requires={{ item.requires }} +{% endif %} [Automount] Where={{ item.where }} diff --git a/roles/common/templates/etc/systemd/system/systemd_mount.j2 b/roles/common/templates/etc/systemd/system/systemd_mount.j2 index b563967..c395618 100644 --- a/roles/common/templates/etc/systemd/system/systemd_mount.j2 +++ b/roles/common/templates/etc/systemd/system/systemd_mount.j2 @@ -6,6 +6,12 @@ Before={{ item.before }} {% if item.after is defined and item.after -%} After={{ item.after }} {% endif %} +{% if item.wants is defined and item.wants -%} +Wants={{ item.wants }} +{% endif %} +{% if item.requires is defined and item.requires -%} +Requires={{ item.requires }} +{% endif %} [Mount] What={{ item.what }} diff --git a/roles/nfs/tasks/main.yml b/roles/nfs/tasks/main.yml index f85164b..c7d4972 100644 --- a/roles/nfs/tasks/main.yml +++ b/roles/nfs/tasks/main.yml @@ -5,6 +5,7 @@ state: present - name: Generate NFS shares + when: nfs_exports is defined and nfs_exports | length block: - name: Ensure directories to export exist ansible.builtin.file: # noqa 208 @@ -28,4 +29,3 @@ enabled: yes tags: - molecule-notest - when: nfs_exports is defined and nfs_exports|length