Browse Source

Use the default `item` loop variable for checks

Tomas Sedovic 7 years ago
parent
commit
bde35d577f

+ 6 - 10
roles/openshift_openstack/tasks/check-prerequisites.yml

@@ -93,17 +93,13 @@
   - "{{ openstack_lb_image }}"
   - "{{ openstack_etcd_image }}"
   - "{{ openstack_dns_image }}"
-  loop_control:
-    loop_var: image
 
 # Check that custom flavors are available
 - include: custom_flavor_check.yaml
   with_items:
-  - "{{ master_flavor }}"
-  - "{{ infra_flavor }}"
-  - "{{ node_flavor }}"
-  - "{{ lb_flavor }}"
-  - "{{ etcd_flavor }}"
-  - "{{ dns_flavor }}"
-  loop_control:
-    loop_var: flavor
+  - "{{ openstack_master_flavor }}"
+  - "{{ openstack_infra_flavor }}"
+  - "{{ openstack_node_flavor }}"
+  - "{{ openstack_lb_flavor }}"
+  - "{{ openstack_etcd_flavor }}"
+  - "{{ openstack_dns_flavor }}"

+ 3 - 2
roles/openshift_openstack/tasks/custom_flavor_check.yaml

@@ -1,9 +1,10 @@
 ---
 - name: Try to get flavor facts
   os_flavor_facts:
-    name: "{{ flavor }}"
+    name: "{{ item }}"
   register: flavor_result
+
 - name: Check that custom flavor is available
   assert:
     that: "flavor_result.ansible_facts.openstack_flavors"
-    msg: "Flavor {{ flavor }} is not available."
+    msg: "Flavor {{ item }} is not available."

+ 2 - 2
roles/openshift_openstack/tasks/custom_image_check.yaml

@@ -1,10 +1,10 @@
 ---
 - name: Try to get image facts
   os_image_facts:
-    image: "{{ image }}"
+    image: "{{ item }}"
   register: image_result
 
 - name: Check that custom image is available
   assert:
     that: "image_result.ansible_facts.openstack_image"
-    msg: "Image {{ image }} is not available."
+    msg: "Image {{ item }} is not available."