autofs/handlers/main.yml
2019-04-08 23:08:29 +02:00

40 lines
1.0 KiB
YAML

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