Kludge to allow iso images in location

This commit is contained in:
Timo Makinen 2022-01-31 18:47:32 +00:00
parent d5a3b4fe2c
commit 6348f267de

View file

@ -62,7 +62,7 @@
tempfile:
state: directory
register: tmpdir
delegate_to: localhost
delegate_to: "{{ vmhost }}"
when:
- inventory_hostname not in result.list_vms
- inject is defined
@ -77,15 +77,14 @@
echo '{{ root_pubkey }}' > /root/.ssh/authorized_keys
%end
dest: "{{ tmpdir.path }}/include.ks"
delegate_to: localhost
delegate_to: "{{ vmhost }}"
when:
- inventory_hostname not in result.list_vms
- inject is defined
- name: run virt-install
command: >
virt-install --connect {{ vmhost_uri }} \
--name {{ inventory_hostname }} \
virt-install --name {{ inventory_hostname }} \
--graphics none --boot useserial=on --noautoconsole \
--serial pty,log.file={{ console_log }} \
--controller usb,model=none --sound none \
@ -107,7 +106,7 @@
{{ virt_install_passthrough }} \
{{ virt_install_network }} \
{{ virt_install_os_args }}
delegate_to: localhost
delegate_to: "{{ vmhost }}"
when: inventory_hostname not in result.list_vms
- name: wait for install to finish
@ -126,7 +125,7 @@
file:
path: "{{ tmpdir.path }}"
state: absent
delegate_to: localhost
delegate_to: "{{ vmhost }}"
when: tmpdir.path is defined
- name: start vm