diff --git a/roles/host_maintenance/templates/systemd_mount.j2 b/roles/host_maintenance/templates/systemd_mount.j2 index d33e640..d2e6acd 100644 --- a/roles/host_maintenance/templates/systemd_mount.j2 +++ b/roles/host_maintenance/templates/systemd_mount.j2 @@ -1,14 +1,29 @@ +{% if item.source is not defined or item.target is not defined or item.mount_type is not defined %} + {% raise exception msg="All of source, target, and mount_type must be defined for each disk entry." %} +{% endif %} + [Unit] Description=Mount {{ item.target }} managed by mylimbo.globals collections, host_maintenance role -#After= -Conflicts={{ item.unit_conflicts }} + +# After dependencies +{% if item.unit_after is defined %} +After={{ item.unit_after }} +{% endif %} + +# Before dependencies +{% if item.unit_before is defined %} Before={{ item.unit_before }} +{% endif %} [Mount] What={{ item.source }} Where={{ item.target }} Type={{ item.mount_type }} + +# Mount options, if specified +{% if item.mount_options is defined %} Options={{ item.mount_options | join(',') }} +{% endif %} [Install] WantedBy=multi-user.target \ No newline at end of file