Explorar el Código

remove stray LCs on deprovision

when a scale group creation is attempted, a launch config is always created. the scale group creation may be a failure (eg. the ami can't be launched as an m5 instance because no ENA support). this leaves behind unreferenced launch configs.

during deprovisioning, try to clean up any orphaned launch configs for each node group.
Joel Diaz hace 7 años
padre
commit
565a3dc08e
Se han modificado 1 ficheros con 13 adiciones y 0 borrados
  1. 13 0
      roles/openshift_aws/tasks/uninstall_node_group.yml

+ 13 - 0
roles/openshift_aws/tasks/uninstall_node_group.yml

@@ -33,3 +33,16 @@
 
   - when: openshift_aws_create_launch_config
     include_tasks: uninstall_launch_config.yml
+
+- name: get list of LCs
+  ec2_lc_facts:
+    region: "{{ openshift_aws_region }}"
+  register: l_launch_config_list
+
+- name: remove stray LCs for this node group
+  ec2_lc:
+    name: "{{ item.launch_configuration_name }}"
+    state: absent
+    region: "{{ openshift_aws_region }}"
+  when: item.launch_configuration_name is match("^{{ openshift_aws_node_group.name }}.*")
+  with_items: "{{ l_launch_config_list.launch_configurations }}"