summaryrefslogtreecommitdiffstats
path: root/test/integration/openshift_health_checker/teardown_container.yml
blob: e84fee1f5e252cdb1acd2cea95186a27fa49f4ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---

# 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
      failed_when: False