Selaa lähdekoodia

Move node group tags to openshift_aws_{master,node}_group.

Andrew Butcher 7 vuotta sitten
vanhempi
commit
c3945d39c9

+ 13 - 12
roles/openshift_aws/defaults/main.yml

@@ -122,12 +122,25 @@ openshift_aws_ami_map:
 openshift_aws_master_group:
 - name: "{{ openshift_aws_clusterid }} master group"
   group: master
+  tags:
+    host-type: master
+    sub-host-type: default
+    runtime: docker
 
 openshift_aws_node_groups:
 - name: "{{ openshift_aws_clusterid }} compute group"
   group: compute
+  tags:
+    host-type: node
+    sub-host-type: compute
+    runtime: docker
+
 - name: "{{ openshift_aws_clusterid }} infra group"
   group: infra
+  tags:
+    host-type: node
+    sub-host-type: infra
+    runtime: docker
 
 openshift_aws_created_asgs: []
 openshift_aws_current_asgs: []
@@ -144,10 +157,6 @@ openshift_aws_master_group_config:
     min_size: 3
     max_size: 3
     desired_size: 3
-    tags:
-      host-type: master
-      sub-host-type: default
-      runtime: docker
     wait_for_instances: True
     termination_policy: "{{ openshift_aws_node_group_termination_policy }}"
     replace_all_instances: "{{ openshift_aws_node_group_replace_all_instances }}"
@@ -167,10 +176,6 @@ openshift_aws_node_group_config:
     min_size: 3
     max_size: 100
     desired_size: 3
-    tags:
-      host-type: node
-      sub-host-type: compute
-      runtime: docker
     termination_policy: "{{ openshift_aws_node_group_termination_policy }}"
     replace_all_instances: "{{ openshift_aws_node_group_replace_all_instances }}"
     iam_role: "{{ openshift_aws_iam_role_name }}"
@@ -186,10 +191,6 @@ openshift_aws_node_group_config:
     min_size: 2
     max_size: 20
     desired_size: 2
-    tags:
-      host-type: node
-      sub-host-type: infra
-      runtime: docker
     termination_policy: "{{ openshift_aws_node_group_termination_policy }}"
     replace_all_instances: "{{ openshift_aws_node_group_replace_all_instances }}"
     iam_role: "{{ openshift_aws_iam_role_name }}"

+ 1 - 1
roles/openshift_aws/tasks/build_node_group.yml

@@ -30,7 +30,7 @@
 - name: query all asg's for this cluster
   ec2_asg_facts:
     region: "{{ openshift_aws_region }}"
-    tags: "{{ {'kubernetes.io/cluster/' ~ openshift_aws_clusterid: openshift_aws_clusterid} | combine(l_node_group_config[openshift_aws_node_group.group].tags) }}"
+    tags: "{{ {'kubernetes.io/cluster/' ~ openshift_aws_clusterid: openshift_aws_clusterid} | combine(openshift_aws_node_group.tags) }}"
   register: asgs
 
 - fail:

+ 1 - 1
roles/openshift_aws/tasks/scale_group.yml

@@ -22,7 +22,7 @@
                                     else (l_node_group_config[openshift_aws_node_group.group].replace_all_instances | default(omit)) }}"
     tags:
     - "{{ openshift_aws_node_group_config_tags
-          | combine(l_node_group_config[openshift_aws_node_group.group].tags)
+          | combine(openshift_aws_node_group.tags)
           | combine({'deployment_serial': l_deployment_serial, 'ami': openshift_aws_ami_map[openshift_aws_node_group.group] | default(openshift_aws_ami)}) }}"
 
 - name: append the asg name to the openshift_aws_created_asgs fact