2018-10-23 14:42:44 +01:00
|
|
|
#
|
|
|
|
# Ensure _remove_tmp_path cleans up the temporary path.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
- name: integration/action/remove_tmp_path.yml
|
|
|
|
hosts: test-targets
|
|
|
|
tasks:
|
|
|
|
#
|
|
|
|
# Use the copy module to cause a temporary directory to be created, and
|
|
|
|
# return a result with a 'src' attribute pointing into that directory.
|
|
|
|
#
|
|
|
|
|
2022-09-12 18:46:21 +01:00
|
|
|
- name: Ensure remove_tmp_path_test
|
|
|
|
copy:
|
2018-10-23 14:42:44 +01:00
|
|
|
dest: /tmp/remove_tmp_path_test
|
|
|
|
content: "{{ 123123 | random }}"
|
|
|
|
register: out
|
|
|
|
|
|
|
|
- stat:
|
|
|
|
path: "{{out.src}}"
|
|
|
|
register: out2
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- not out2.stat.exists
|
2021-09-07 22:10:25 +01:00
|
|
|
fail_msg: out={{out}}
|
2018-10-23 14:42:44 +01:00
|
|
|
|
|
|
|
- stat:
|
|
|
|
path: "{{out.src|dirname}}"
|
|
|
|
register: out2
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- not out2.stat.exists
|
2021-09-07 22:10:25 +01:00
|
|
|
fail_msg: out={{out}}
|
2018-10-23 14:42:44 +01:00
|
|
|
|
|
|
|
- file:
|
|
|
|
path: /tmp/remove_tmp_path_test
|
|
|
|
state: absent
|
2021-11-02 20:07:28 +00:00
|
|
|
tags:
|
|
|
|
- remove_tmp_path
|