terminate.yml 949 B

1234567891011121314151617181920212223242526
  1. ---
  2. - name: Terminate instance(s)
  3. hosts: localhost
  4. gather_facts: no
  5. vars_files:
  6. - vars.yml
  7. tasks:
  8. - set_fact: scratch_group=tag_env-host-type_{{ cluster_id }}-openshift-node
  9. - add_host:
  10. name: "{{ item }}"
  11. groups: oo_nodes_to_terminate
  12. ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
  13. ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
  14. with_items: groups[scratch_group] | default([]) | difference(['localhost'])
  15. - set_fact: scratch_group=tag_env-host-type_{{ cluster_id }}-openshift-master
  16. - add_host:
  17. name: "{{ item }}"
  18. groups: oo_masters_to_terminate
  19. ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
  20. ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
  21. with_items: groups[scratch_group] | default([]) | difference(['localhost'])
  22. - include: ../openshift-node/terminate.yml
  23. - include: ../openshift-master/terminate.yml