Fix copying nfs_shares configuration
Using the `when` conditional on a `with_` loop gets evaluated on each loop iteration and will not skip a task entirely. Use the `skip` attribute to ignore errors in this scenario but only `skip` when `enable_cinder_backend_nfs` is not enabled. If it is enabled the `nfs_shares` file should be required and this task should fail if it does not exist. Co-authored-by: Andrew Widdersheim <amwiddersheim@gmail.com> Change-Id: I6b997dd943efe7b16beb63899c1488fa5353d996 Closes-Bug: #1641183
This commit is contained in:
parent
9099b8be4d
commit
7bb88390d8
@ -55,8 +55,9 @@
|
|||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: "{{ node_config_directory }}/cinder-volume/nfs_shares"
|
dest: "{{ node_config_directory }}/cinder-volume/nfs_shares"
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "{{ node_custom_config }}/nfs_shares.j2"
|
- files:
|
||||||
- "{{ node_custom_config }}/cinder/nfs_shares.j2"
|
- "{{ node_custom_config }}/nfs_shares.j2"
|
||||||
- "{{ node_custom_config }}/cinder/cinder-volume/nfs_shares.j2"
|
- "{{ node_custom_config }}/cinder/nfs_shares.j2"
|
||||||
- "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/nfs_shares.j2"
|
- "{{ node_custom_config }}/cinder/cinder-volume/nfs_shares.j2"
|
||||||
when: enable_cinder_backend_nfs | bool
|
- "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/nfs_shares.j2"
|
||||||
|
skip: "{{ not enable_cinder_backend_nfs | bool }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user