replace command module running mktemp with tempfile module
[noc.git] / ansible / roles / usb-install / tasks / main.yml
1 ---
2 - block:
3     - name: Create temporary workdir
4       tempfile:
5         state: directory
6       register: tmpdir
7
8     - import_role:
9         name: preseed
10       vars:
11         preseed_tmpdir: "{{ tmpdir.path }}"
12
13     - name: Copy the preseed initramfs to the artifacts directory
14       copy:
15         src: "{{ tmpdir.path }}/initrd.preseed.gz"
16         dest: "{{ artifacts_dir }}/"
17
18
19   always:
20     - name: Cleanup temporary workdir
21       file:
22         path: "{{ tmpdir.path }}"
23         state: absent