Skip to content

Commit 2ed5914

Browse files
authored
Update in 'pre-flight-checks-openstack', main.yml (#288)
If an inventory has only [hypervisors] group defined and does NOT have [cinder] group, existing `when` condition in a 'cinder' related tasks is failing to execute because the current host(`inventory_hostname`) is not found in the `cinder` group. This patch is modifying that `when` condition to first check if the [cinder] group exist in the inventory and then check if the current host is part of it.
1 parent 70c50cc commit 2ed5914

File tree

1 file changed

+3
-3
lines changed
  • roles/pre-flight-checks-openstack/tasks

1 file changed

+3
-3
lines changed

roles/pre-flight-checks-openstack/tasks/main.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@
101101
stat:
102102
path: "{{cinder_image_conversion_cache}}"
103103
register: cinder_image_conversion_cache_dir_exists
104-
when: inventory_hostname in groups['cinder']
104+
when: "'cinder' in groups and inventory_hostname in groups['cinder']"
105105

106106
- debug: var=cinder_image_conversion_cache_dir_exists
107-
when: inventory_hostname in groups['cinder']
107+
when: "'cinder' in groups and inventory_hostname in groups['cinder']"
108108

109109
- block:
110110
- debug: msg="Validate minimum free space for cinder_image_conversion_cache (at least {{cinder_image_cache_min_free_space}} KBytes)"
@@ -118,4 +118,4 @@
118118
- fail:
119119
msg="Insufficient free space in {{cinder_image_conversion_cache}} (found {{cinder_cache_free_space.stdout.strip()}} mimimum required = {{cinder_image_cache_min_free_space}})"
120120
when: cinder_cache_free_space.stdout.strip() | int < cinder_image_cache_min_free_space
121-
when: inventory_hostname in groups['cinder'] and cinder_image_conversion_cache_dir_exists == true
121+
when: "'cinder' in groups and inventory_hostname in groups['cinder'] and cinder_image_conversion_cache_dir_exists == true"

0 commit comments

Comments
 (0)