Restart systemd *-fs.target.
This commit is contained in:
parent
c95518aa1a
commit
00d2ccada2
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
@ -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
|
||||||
|
|
Reference in New Issue