Quellcode durchsuchen

Use OPENSHIFT_CLUSTER env in OpenStack uninstall

The OpenStack's `provision.yml` playbook allows setting a different name
for the OpenShift cluster being created using the OPENSHIFT_CLUSTER
environment variable.

This variable was being ignored in the `uninstall.yml` playbook which
means it would try to remove a different set of OpenStack resources.
Tomas Sedovic vor 6 Jahren
Ursprung
Commit
d9cc6d17bd
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  1. 3 0
      playbooks/openstack/openshift-cluster/uninstall.yml

+ 3 - 0
playbooks/openstack/openshift-cluster/uninstall.yml

@@ -29,6 +29,9 @@
 - name: Remove OpenStack resources
   hosts: localhost
   tasks:
+  - name: retrieve cluster name from the environment if present
+    set_fact:
+      openshift_openstack_stack_name: "{{ lookup('env', 'OPENSHIFT_CLUSTER') | ternary (lookup('env', 'OPENSHIFT_CLUSTER'), omit) }}"
   - name: Remove OpenStack resources
     import_role:
       name: openshift_openstack