2
0
Fork 0

Restart systemd *-fs.target.

This commit is contained in:
Jeremy Gardais 2017-07-21 15:35:34 +02:00
parent c95518aa1a
commit 00d2ccada2
3 changed files with 13 additions and 0 deletions

View File

@ -37,6 +37,7 @@ This role will:
* Create the mountpoint directory. * Create the mountpoint directory.
* Add an entry in `/etc/fstab`. * Add an entry in `/etc/fstab`.
* Ensure to mount the device if specified. * Ensure to mount the device if specified.
* Restart systemd's filesystem.target to ensure automount device works.
## Development ## Development

11
handlers/main.yml Normal file
View File

@ -0,0 +1,11 @@
---
# handlers file for mounts
- name: restart fs.target
systemd:
name: "{{ item }}"
state: restarted
daemon_reload: yes
with_items:
- local-fs.target
- remote-fs.target

View File

@ -15,3 +15,4 @@
opts: "{{ item.opts | default(mounts_opts) }}" opts: "{{ item.opts | default(mounts_opts) }}"
state: "{{ item.state | default(mounts_state) }}" state: "{{ item.state | default(mounts_state) }}"
with_items: "{{ mounts_list }}" with_items: "{{ mounts_list }}"
notify: restart fs.target