autofs/handlers/main.yml
2019-01-12 19:12:55 +01:00

38 lines
1.1 KiB
YAML

- name: Reload systemd
systemd:
daemon_reload: yes
when: systemd_mounts_manage_service
- name: Start systemd mount
systemd:
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.mount"
state: started
with_dict: "{{ systemd_mounts }}"
when: systemd_mounts_manage_service
- name: Start systemd automount
systemd:
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.automount"
state: started
with_dict: "{{ systemd_mounts }}"
when: systemd_mounts_manage_service
- name: Enable systemd mount
systemd:
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.mount"
enabled: yes
with_dict: "{{ systemd_mounts }}"
notify:
- Start systemd mount
when: item.value.automount == false
- name: Enable systemd automount
systemd:
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.automount"
enabled: yes
with_dict: "{{ systemd_mounts }}"
notify:
- Start systemd automount
when: item.value.automount == true