ansible-role-systemd_mount/templates/systemd-mount.j2
Kevin Carter 6a9dcb6886 Ensure mounts are able to be network aware
The mount unit can take requires and after statements which help ensure
mounts are "mounted" at the appropriate times. This change ensures that
mounts that do not begin with a "/" have network aware statements in
them automatically which ensures things like NFS, CIFS, or iSCSI mounts
are correctly handled at the time of system start.

Change-Id: I0afa240ea4792710b9d6e84831ccac01e0cb3972
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2019-01-04 20:06:45 +00:00

22 lines
544 B
Django/Jinja

# {{ ansible_managed }}
[Unit]
Description=Auto mount for {{ systemd_mount_item }}
{% if not (item.what is search("^/.*")) or not (item.what is search("^//.*")) %}
Requires=network-online.target
After=network-online.target
{% endif %}
[{{ systemd_mount_suffix | capitalize }}]
What={{ item.what }}
{% if item.type == 'swap' %}
Priority={{ item.priority | default(0) }}
{% else %}
Where={{ item.where }}
Type={{ item.type }}
{% endif %}
Options={{ item.options | default(systemd_default_mount_options) }}
[Install]
WantedBy=multi-user.target