Appendix B. Reinstall Red Hat OpenShift Container Platform

In case of a misconfiguration that puts the OpenShift installation into an unrecoverable state, it is easiest to delete all environment instances and start over. Before deleting the instances, it is wise to first recover the subscriptions by unregistering the nodes. This may be performed with an Ansible ad-hoc command:

$ ansible nodes -a 'subscription-manager unregister'

To aid in VM deletion, copy the list of virtual machines vms: from the infrastructure deployment playbook, ovirt-vm-infra.yaml. An alternative playbook may be created from the vms list using the following syntax:

$ cat ovirt-vm-uninstall.yaml
---
- name Remove VMs
  hosts: localhost
  vars:
    vms:
... [ VM list here ] ...
  tasks:
    - name: Set VMs absent
      ovirt_vms:
        auth: "{{ ovirt_auth }}"
        name: "{{ item }}"
        state: absent
      with_items:
        - "{{ vms }}"
  pre_tasks:
    - name: Log in to oVirt
      ovirt_auth:
        url: "{{ engine_url }}"
        username: "{{ engine_user }}"
        password: "{{ engine_password }}"
        ca_file: "{{ engine_cafile | default(omit) }}"
        insecure: "{{ engine_insecure | default(true) }}"
      tags:
        - always
  post_tasks:
    - name: Logout from oVirt
      ovirt_auth:
        state: absent
        ovirt_auth: "{{ ovirt_auth }}"
      tags:
        - always

Call this playbook in the same manner as the infrastructure creation playbook:

$ ansible-playbook -e@~vault.yaml playbooks/ovirt-vm-uninstall.yaml