Jim Rigsbee
2019-07-19 bf41614acf5edce1f082dc89424ae68220a509c3
ansible/configs/ocp4-workshop/destroy_env.yml
@@ -139,6 +139,33 @@
                    aws ec2 wait instance-running
                    --filters "Name=tag:clusterid,Values={{ cluster_name }}"
- name: Remove workloads
  hosts: bastions
  gather_facts: false
  run_once: true
  become: false
  tasks:
  - name: Remove ocp workloads
    when:
    - remove_workloads | d("") | length > 0
    tags:
    - remove_workloads
    block:
      - name: Set facts for remote access
        set_fact:
          ansible_ssh_extra_args: >-
            {{ ansible_ssh_extra_args|d() }}
            -F {{hostvars.localhost.output_dir}}/{{ env_type }}_{{ guid }}_ssh_conf
      - name: Invoke roles to remove ocp workloads
        include_role:
          name: "{{ workload_loop_var }}"
        vars:
          ocp_username: "system:admin"
          ACTION: "remove"
        loop: "{{ remove_workloads }}"
        loop_control:
          loop_var: workload_loop_var
- name: Destroy OCP 4 resources using the installer
  hosts: bastions
  gather_facts: false