remove_scale_group.yml 772 B

123456789101112131415161718192021222324252627
  1. ---
  2. - name: fetch the scale groups
  3. ec2_asg_facts:
  4. region: "{{ openshift_aws_region }}"
  5. tags:
  6. "{{ {'kubernetes.io/cluster/' ~ openshift_aws_clusterid: openshift_aws_clusterid,
  7. 'version': openshift_aws_current_version} }}"
  8. register: qasg
  9. - name: remove non-master scale groups
  10. ec2_asg:
  11. region: "{{ openshift_aws_region }}"
  12. state: absent
  13. name: "{{ item.auto_scaling_group_name }}"
  14. when: "'master' not in item.auto_scaling_group_name"
  15. register: asg_results
  16. with_items: "{{ qasg.results }}"
  17. async: 600
  18. poll: 0
  19. - name: join the asynch scale group removals
  20. async_status:
  21. jid: "{{ item.ansible_job_id }}"
  22. register: jobs_results
  23. with_items: "{{ asg_results.results }}"
  24. until: jobs_results.finished
  25. retries: 200