[CICDANSIBLE] Add availability_zone Heat stack parameter 56/127656/6
authorBartek Grzybowski <b.grzybowski@partner.samsung.com>
Thu, 10 Mar 2022 13:09:49 +0000 (14:09 +0100)
committerBartek Grzybowski <b.grzybowski@partner.samsung.com>
Fri, 11 Mar 2022 11:42:35 +0000 (11:42 +0000)
This will allow parametrizing the availability zone in cicdansible

Change-Id: Ia825b01e246acf7877b66665d436f0c4a1991b60
Issue-ID: OOM-2935
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
tools/cicdansible/group_vars/all.yml
tools/cicdansible/heat/installer.yaml
tools/cicdansible/heat/instance.yaml
tools/cicdansible/heat/node.yaml
tools/cicdansible/roles/setup_openstack_infrastructure/tasks/deploy/heat.yml

index 4d04466..141bc5f 100644 (file)
@@ -26,6 +26,8 @@ infra_flavor_name: ""
 installer_flavor_name: ""
 #Name of the image for instances.
 image_name: ""
+#Name of openstack availability zone to use for instances
+availability_zone: "nova"
 #Whether to use a volume for /dockerdata-nfs or to use ephemeral disk.
 #True by default, most openstack providers offer ssd volumes probably.
 use_volume_for_nfs: true
index 101c526..885bc8a 100644 (file)
@@ -34,6 +34,10 @@ parameters:
     constraints:
       - custom_constraint: glance.image
         description: "must specify a valid image name"
+  availability_zone:
+    label: "availability zone"
+    description: "availability zone to use for scheduling instances"
+    type: string
   subnet_cidr:
     label: "private subnet cidr"
     description: "Cidr of a private subnet instances will be connected to"
@@ -213,6 +217,7 @@ resources:
           network: { get_resource: privnet }
           subnet: { get_resource: privsubnet }
           flavor_name: { get_param: node_flavor_name }
+          availability_zone: { get_param: availability_zone }
           notify_command: { get_attr: ["instance_wait_handle", "curl_cli"] }
           security_group: { get_resource: secgroup }
           demo_network: { get_param: demo_network }
@@ -255,6 +260,7 @@ resources:
       subnet: { get_resource: privsubnet }
       key_name: { get_resource: key }
       flavor_name: { get_param: infra_flavor_name }
+      availability_zone: { get_param: availability_zone }
       image_name: { get_param: image_name }
       notify_command: { get_attr: ["instance_wait_handle", "curl_cli"] }
       security_group: { get_resource: secgroup }
@@ -280,6 +286,7 @@ resources:
       instance_name: installer
       image_name: { get_param: image_name }
       flavor_name: { get_param: installer_flavor_name }
+      availability_zone: { get_param: availability_zone }
       key_name: { get_resource: key }
       network: { get_resource: privnet }
       subnet: { get_resource: privsubnet }
index 7d9715f..30d8eea 100644 (file)
@@ -24,6 +24,8 @@ parameters:
   demo_network:
     type: string
     default: ""
+  availability_zone:
+    type: string
 conditions:
   #Condition for demo network connection
   connect_demo_net:
@@ -57,6 +59,7 @@ resources:
       name: { get_param: instance_name }
       image: { get_param: image_name }
       flavor: { get_param: flavor_name }
+      availability_zone: { get_param: availability_zone }
       key_name: { get_param: key_name }
       config_drive: true
       networks:
index bee089f..9562228 100644 (file)
@@ -27,6 +27,8 @@ parameters:
     default: ""
   docker_storage_size:
     type: number
+  availability_zone:
+    type: string
 resources:
   #Volume for storing /var/lib/docker for node.
   docker_storage:
@@ -47,6 +49,7 @@ resources:
       network: { get_param: network }
       subnet: { get_param: subnet }
       flavor_name: { get_param: flavor_name }
+      availability_zone: { get_param: availability_zone }
       notify_command: { get_param: notify_command }
       security_group: { get_param: security_group }
       scheduler_hints: { get_param: scheduler_hints }
index 609306b..7fb2984 100644 (file)
@@ -30,6 +30,7 @@
       node_flavor_name: "{{ node_flavor_name }}"
       infra_flavor_name: "{{ infra_flavor_name }}"
       installer_flavor_name: "{{ installer_flavor_name }}"
+      availability_zone: "{{ availability_zone }}"
       node_ip: "{{ floating_ips_by_address[first_node_ip].id }}"
       infra_ip: "{{ floating_ips_by_address[infra_ip].id }}"
       installer_ip: "{{ floating_ips_by_address[installer_ip].id }}"