More robust way to install python to hosts

This commit is contained in:
Timo Makinen 2025-06-18 10:03:57 +00:00
parent 78ac8fc6f4
commit e716951798
2 changed files with 9 additions and 7 deletions

View file

@ -15,4 +15,8 @@ num_cpus: 2
# extra args for virt-install
virt_install_os_args: --cdrom {{ boot_url }}/openbsd/openbsd.iso
virt_install_os_variant: openbsd7.6
virt_install_python_cmd: pkg_add -I -x python%3
virt_install_python_cmd:
- pkg_add
- -I
- -x
- python%3

View file

@ -170,12 +170,10 @@
when: inventory_hostname not in result.list_vms
- name: Install python if required
ansible.builtin.command:
argv:
- ssh
- "{{ inventory_hostname }}"
- "{{ virt_install_python_cmd }}"
delegate_to: localhost
ansible.builtin.raw: >-
{{ virt_install_python_cmd | map('quote') | join(' ') }}
args:
executable: /bin/sh
when:
- inventory_hostname not in result.list_vms
- virt_install_python_cmd is defined