autofs/handlers/main.yml

38 lines
1000 B
YAML
Raw Normal View History

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