# _execute_module() would unconditionally delete shell.tmpdir without
# respecting the passed in 'tmp' parameter on Ansible 2.3.

- name: regression/issue_558_unarchive_failed.yml
  hosts: test-targets
  tasks:
  - name: Cleanup /tmp/foo
    file:
      path: /tmp/foo
      state: absent
  - name: Create /tmp/foo
    file:
      path: /tmp/foo
      state: directory
  - name: Unarchive unarchive_test.tar
    unarchive:
      src: "{{git_basedir}}/tests/data/unarchive_test.tar"
      dest: /tmp/foo
    # garbage doesn't work with BSD tar
    when: ansible_system != 'Darwin'
  tags:
    - issue_558
