autofs/handlers/main.yml

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