---
- name: Create temporary build directory
- command: mktemp --tmpdir -d openwrt-{{ inventory_hostname }}.XXXXXX
+ tempfile:
+ state: directory
register: tmpdir
- set_fact:
- openwrt_imgbuilder_dir: "{{ tmpdir.stdout }}"
- openwrt_imgbuilder_files: "{{ tmpdir.stdout }}/files"
+ openwrt_imgbuilder_dir: "{{ tmpdir.path }}"
+ openwrt_imgbuilder_files: "{{ tmpdir.path }}/files"
- name: Create the directories for mixins
file:
---
- block:
- name: Create temporary workdir
- command: mktemp -d
+ tempfile:
+ state: directory
register: tmpdir
- import_role:
name: preseed
vars:
- preseed_tmpdir: "{{ tmpdir.stdout }}"
+ preseed_tmpdir: "{{ tmpdir.path }}"
- name: Copy the preseed initramfs to the artifacts directory
copy:
- src: "{{ tmpdir.stdout }}/initrd.preseed.gz"
+ src: "{{ tmpdir.path }}/initrd.preseed.gz"
dest: "{{ artifacts_dir }}/"
always:
- name: Cleanup temporary workdir
file:
- path: "{{ tmpdir.stdout }}"
+ path: "{{ tmpdir.path }}"
state: absent
- block:
- name: create a temporary workdir
- command: mktemp -d
+ tempfile:
+ state: directory
register: tmpdir
- import_role:
vars:
ssh_users_root: "{{ hostvars[hostname].ssh_users_root }}"
install_interface: enp1s1
- preseed_tmpdir: "{{ tmpdir.stdout }}"
+ preseed_tmpdir: "{{ tmpdir.path }}"
- name: Make preseed workdir readable by qemu
acl:
- path: "{{ tmpdir.stdout }}"
+ path: "{{ tmpdir.path }}"
state: present
entity: libvirt-qemu
etype: user
xml: "{{ lookup('template', 'libvirt-domain.xml.j2') }}"
vars:
run_installer: yes
- preseed_tmpdir: "{{ tmpdir.stdout }}"
+ preseed_tmpdir: "{{ tmpdir.path }}"
- name: start vm
virt:
always:
- name: cleanup temporary workdir
file:
- path: "{{ tmpdir.stdout }}"
+ path: "{{ tmpdir.path }}"
state: absent
- name: define new production vm