autofs/handlers/main.yml
2019-01-27 20:17:42 +01:00

38 lines
1000 B
YAML

- name: Reload systemd
systemd:
daemon_reload: yes
become: yes
- name: Start systemd mount
systemd:
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.mount"
state: started
with_dict: "{{ systemd_mounts }}"
become: yes
- name: Start systemd automount
systemd:
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.automount"
state: started
with_dict: "{{ systemd_mounts }}"
become: yes
- 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
become: yes
- name: Enable systemd automount
systemd:
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.automount"
enabled: yes
with_dict: "{{ systemd_mounts }}"
when: item.value.automount == true
become: yes