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 }}"
|
2023-12-23 19:39:29 +00:00
|
|
|
when: item.value.automount == false and item.value.enabled==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: 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
|
|
|
|
2023-12-23 19:39:29 +00:00
|
|
|
when: item.value.automount == true and item.value.enabled==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 }}"
|
2023-12-23 19:39:29 +00:00
|
|
|
when: item.value.automount == false and item.value.enabled==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 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 }}"
|
2023-12-23 19:39:29 +00:00
|
|
|
when: item.value.automount == true and item.value.enabled==true
|
2019-04-08 21:08:29 +00:00
|
|
|
become: yes
|