summaryrefslogtreecommitdiffstats
path: root/test/integration/openshift_health_checker/teardown_container.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/openshift_health_checker/teardown_container.yml')
-rw-r--r--test/integration/openshift_health_checker/teardown_container.yml23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/integration/openshift_health_checker/teardown_container.yml b/test/integration/openshift_health_checker/teardown_container.yml
new file mode 100644
index 000000000..fe11e2617
--- /dev/null
+++ b/test/integration/openshift_health_checker/teardown_container.yml
@@ -0,0 +1,23 @@
+---
+
+# Include this to delete the current test host container.
+#
+# In order to recover from test exceptions, this cleanup is expected to
+# be done in an "always:" task on the same block as the test task(s). So
+# it happens in a task "on" the host being tested. In order to delete the
+# host's container, the task uses its own hostname (which is same as the
+# container name) but delegates the docker action to localhost.
+
+- block:
+
+ # so handlers don't break the test by trying to run after teardown:
+ - meta: flush_handlers
+
+ always:
+
+ - name: delete test container
+ delegate_to: localhost
+ connection: local
+ docker_container:
+ name: "{{ inventory_hostname }}"
+ state: absent