aboutsummaryrefslogtreecommitdiff
path: root/ansible
diff options
context:
space:
mode:
authorMauricio Lima <mauriciolimab@gmail.com>2016-11-11 14:51:14 -0300
committerAndrew Widdersheim <amwiddersheim@gmail.com>2016-11-11 14:33:26 -0500
commit7bb88390d88aebfc257e09e7e055a09fe4121782 (patch)
tree50c5088a3013a963dd7565d402b7fc0b4ed36f8f /ansible
parent9099b8be4d019277d3ac26f813ee3316c43c04fd (diff)
downloadkolla-7bb88390d88aebfc257e09e7e055a09fe4121782.tar.gz
kolla-7bb88390d88aebfc257e09e7e055a09fe4121782.zip
Fix copying nfs_shares configuration4.0.0.0b1
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
Diffstat (limited to 'ansible')
-rw-r--r--ansible/roles/cinder/tasks/config.yml11
1 files changed, 6 insertions, 5 deletions
diff --git a/ansible/roles/cinder/tasks/config.yml b/ansible/roles/cinder/tasks/config.yml
index ecdd67c40..9daa82c44 100644
--- a/ansible/roles/cinder/tasks/config.yml
+++ b/ansible/roles/cinder/tasks/config.yml
@@ -55,8 +55,9 @@
src: "{{ item }}"
dest: "{{ node_config_directory }}/cinder-volume/nfs_shares"
with_first_found:
- - "{{ node_custom_config }}/nfs_shares.j2"
- - "{{ node_custom_config }}/cinder/nfs_shares.j2"
- - "{{ node_custom_config }}/cinder/cinder-volume/nfs_shares.j2"
- - "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/nfs_shares.j2"
- when: enable_cinder_backend_nfs | bool
+ - files:
+ - "{{ node_custom_config }}/nfs_shares.j2"
+ - "{{ node_custom_config }}/cinder/nfs_shares.j2"
+ - "{{ node_custom_config }}/cinder/cinder-volume/nfs_shares.j2"
+ - "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/nfs_shares.j2"
+ skip: "{{ not enable_cinder_backend_nfs | bool }}"