瀏覽代碼

Merge pull request #8018 from joelddiaz/cleanup_stray_lcs

remove stray LCs on deprovision
OpenShift Merge Robot 7 年之前
父節點
當前提交
8aab3e7eac
共有 1 個文件被更改,包括 13 次插入0 次删除
  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 }}"