diff --git a/README.md b/README.md index 8db383e..cd5d2e5 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ This role will : * Create the mountpoint directory. * Add an entry in `/etc/fstab`. * Ensure to mount the device if specified. +* Restart systemd's filesystem.target to ensure automount device works. ## Development diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..439b539 --- /dev/null +++ b/handlers/main.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index 80599e0..35399d6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -15,3 +15,4 @@ opts: "{{ item.opts | default(mounts_opts) }}" state: "{{ item.state | default(mounts_state) }}" with_items: "{{ mounts_list }}" + notify: restart fs.target