Browse Source

Updating node group mappings to use an openshift specific tag.

Kenny Woodson 6 years ago
parent
commit
0c5b36ad08

+ 4 - 6
roles/openshift_aws/defaults/main.yml

@@ -152,14 +152,16 @@ openshift_aws_ami_map:
 openshift_aws_master_group:
 - name: "{{ openshift_aws_clusterid }} master group"
   group: master
+  node_group_config: node-config-master
   tags:
     host-type: master
-    sub-host-type: master
+    sub-host-type: default
     runtime: docker
 
 openshift_aws_node_groups:
 - name: "{{ openshift_aws_clusterid }} compute group"
   group: compute
+  node_group_config: node-config-compute
   tags:
     host-type: node
     sub-host-type: compute
@@ -167,16 +169,12 @@ openshift_aws_node_groups:
 
 - name: "{{ openshift_aws_clusterid }} infra group"
   group: infra
+  node_group_config: node-config-infra
   tags:
     host-type: node
     sub-host-type: infra
     runtime: docker
 
-openshift_aws_node_group_mappings:
-  master: 'node-config-master'
-  compute: 'node-config-compute'
-  infra: 'node-config-infra'
-
 openshift_aws_created_asgs: []
 openshift_aws_current_asgs: []
 

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

@@ -23,7 +23,8 @@
     tags:
     - "{{ openshift_aws_node_group_config_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)}) }}"
+          | combine({'deployment_serial': l_deployment_serial, 'ami': openshift_aws_ami_map[openshift_aws_node_group.group] | default(openshift_aws_ami)})
+          | combine({'openshift-node-group-config': openshift_aws_node_group.node_group_config | default('unset') }) }}"
 
 - name: append the asg name to the openshift_aws_created_asgs fact
   set_fact:

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

@@ -26,7 +26,7 @@
     groups: "{{ openshift_aws_masters_groups }}"
     name: "{{ item.public_dns_name }}"
     hostname: "{{ openshift_aws_clusterid }}-master-{{ item.instance_id[:-5] }}"
-    openshift_node_group_name: "{{ openshift_aws_node_group_mappings[item.tags['sub-host-type']] }}"
+    openshift_node_group_name: "{{ item.tags['openshift-node-group-config'] | default('unset') }}"
   with_items: "{{ instancesout.instances }}"
 
 - name: wait for ssh to become available

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

@@ -46,5 +46,5 @@
     ansible_ssh_host: "{{ item.public_dns_name }}"
     name: "{{ item.public_dns_name }}"
     hostname: "{{ item.public_dns_name }}"
-    openshift_node_group_name: "{{ openshift_aws_node_group_mappings[item.tags['sub-host-type']] }}"
+    openshift_node_group_name: "{{ item.tags['openshift-node-group-config'] | default('unset') }}"
   with_items: "{{ qinstances.instances }}"

+ 1 - 1
roles/openshift_aws/templates/user_data.j2

@@ -7,7 +7,7 @@ write_files:
   owner: 'root:root'
   permissions: '0640'
   content: |
-    openshift_group_type: {{ openshift_aws_node_group.group }}
+    openshift_node_config_name: {{ openshift_aws_node_group.node_group_config | default('unset') }}
 {%   if openshift_aws_node_group.group != 'master' %}
 - path: /etc/origin/node/bootstrap.kubeconfig
   owner: 'root:root'

+ 1 - 1
roles/openshift_node/templates/bootstrap.yml.j2

@@ -44,7 +44,7 @@
         line: "{{ item.line }}"
         regexp: "{{ item.regexp }}"
       with_items:
-      - line: "BOOTSTRAP_CONFIG_NAME=node-config-{{ openshift_group_type }}"
+      - line: "BOOTSTRAP_CONFIG_NAME={{ openshift_node_config_name }}"
         regexp: "^BOOTSTRAP_CONFIG_NAME=.*"
 {% endraw %}