feat: by mount enable flag instead dedicated variable
This commit is contained in:
parent
bf15d49fe8
commit
4db724ba69
@ -1,5 +1,4 @@
|
|||||||
systemd_mounts: {}
|
systemd_mounts: {}
|
||||||
systemd_mounts_enabled: []
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -8,4 +7,4 @@ systemd_mounts_enabled: []
|
|||||||
# type:
|
# type:
|
||||||
# path:
|
# path:
|
||||||
# username:
|
# username:
|
||||||
# password:
|
# password:
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.mount"
|
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.mount"
|
||||||
enabled: yes
|
enabled: yes
|
||||||
with_dict: "{{ systemd_mounts }}"
|
with_dict: "{{ systemd_mounts }}"
|
||||||
when: item.value.automount == false
|
when: item.value.automount == false and item.value.enabled==true
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
- name: Enable systemd automount
|
- name: Enable systemd automount
|
||||||
@ -18,7 +18,7 @@
|
|||||||
enabled: yes
|
enabled: yes
|
||||||
with_dict: "{{ systemd_mounts }}"
|
with_dict: "{{ systemd_mounts }}"
|
||||||
|
|
||||||
when: item.value.automount == true
|
when: item.value.automount == true and item.value.enabled==true
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
|
|
||||||
@ -27,7 +27,7 @@
|
|||||||
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.mount"
|
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.mount"
|
||||||
state: started
|
state: started
|
||||||
with_dict: "{{ systemd_mounts }}"
|
with_dict: "{{ systemd_mounts }}"
|
||||||
when: item.value.automount == false
|
when: item.value.automount == false and item.value.enabled==true
|
||||||
become: yes
|
become: yes
|
||||||
|
|
||||||
- name: Start systemd automount
|
- name: Start systemd automount
|
||||||
@ -35,5 +35,5 @@
|
|||||||
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.automount"
|
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.automount"
|
||||||
state: started
|
state: started
|
||||||
with_dict: "{{ systemd_mounts }}"
|
with_dict: "{{ systemd_mounts }}"
|
||||||
when: item.value.automount == true
|
when: item.value.automount == true and item.value.enabled==true
|
||||||
become: yes
|
become: yes
|
||||||
|
@ -65,7 +65,6 @@
|
|||||||
- Enable systemd mount
|
- Enable systemd mount
|
||||||
- Start systemd mount
|
- Start systemd mount
|
||||||
become: yes
|
become: yes
|
||||||
when: item.key in systemd_mounts_enabled
|
|
||||||
|
|
||||||
- name: SYSTEMD MOUNT | Setup systemd Service for automount
|
- name: SYSTEMD MOUNT | Setup systemd Service for automount
|
||||||
template:
|
template:
|
||||||
@ -77,7 +76,7 @@
|
|||||||
- Enable systemd automount
|
- Enable systemd automount
|
||||||
- Start systemd automount
|
- Start systemd automount
|
||||||
become: yes
|
become: yes
|
||||||
when: item.value.automount is defined and item.value.automount == true and item.key in systemd_mounts_enabled
|
when: item.value.automount is defined and item.value.automount == true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user