Skip to content

Commit

Permalink
Merge pull request #203 from vladgh:systemd
Browse files Browse the repository at this point in the history
Improve SystemD mount services
  • Loading branch information
vladgh authored Oct 8, 2022
2 parents 1520847 + a9708a8 commit dc2c0ee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions roles/common/templates/etc/systemd/system/systemd_mount.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion roles/nfs/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,4 +29,3 @@
enabled: yes
tags:
- molecule-notest
when: nfs_exports is defined and nfs_exports|length

0 comments on commit dc2c0ee

Please sign in to comment.