summaryrefslogtreecommitdiffstats
path: root/test/integration/openshift_health_checker/teardown_container.yml
blob: fe11e2617902e01868305241338db55ac9dd34c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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