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_enabled: []
|
||||
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.mount"
|
||||
enabled: yes
|
||||
with_dict: "{{ systemd_mounts }}"
|
||||
when: item.value.automount == false
|
||||
when: item.value.automount == false and item.value.enabled==true
|
||||
become: yes
|
||||
|
||||
- name: Enable systemd automount
|
||||
@ -18,7 +18,7 @@
|
||||
enabled: yes
|
||||
with_dict: "{{ systemd_mounts }}"
|
||||
|
||||
when: item.value.automount == true
|
||||
when: item.value.automount == true and item.value.enabled==true
|
||||
become: yes
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.mount"
|
||||
state: started
|
||||
with_dict: "{{ systemd_mounts }}"
|
||||
when: item.value.automount == false
|
||||
when: item.value.automount == false and item.value.enabled==true
|
||||
become: yes
|
||||
|
||||
- name: Start systemd automount
|
||||
@ -35,5 +35,5 @@
|
||||
name: "{{ item.value.mount[1:] | replace('-', '\\x2d') | replace('/', \"-\") }}.automount"
|
||||
state: started
|
||||
with_dict: "{{ systemd_mounts }}"
|
||||
when: item.value.automount == true
|
||||
when: item.value.automount == true and item.value.enabled==true
|
||||
become: yes
|
||||
|
@ -65,7 +65,6 @@
|
||||
- Enable systemd mount
|
||||
- Start systemd mount
|
||||
become: yes
|
||||
when: item.key in systemd_mounts_enabled
|
||||
|
||||
- name: SYSTEMD MOUNT | Setup systemd Service for automount
|
||||
template:
|
||||
@ -77,7 +76,7 @@
|
||||
- Enable systemd automount
|
||||
- Start systemd automount
|
||||
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