Force python3 install when provisioning OpenBSD

This commit is contained in:
Timo Makinen 2020-09-01 20:15:15 +00:00
parent 51aa0a709e
commit f60fb7f88c
2 changed files with 9 additions and 1 deletions

View file

@ -1,6 +1,6 @@
--- ---
# fix python path errors # fix python path errors
ansible_python_interpreter: "/usr/bin/env python" ansible_python_interpreter: "/usr/local/bin/python3"
# we have real wheel group # we have real wheel group
ansible_wheel: wheel ansible_wheel: wheel
@ -17,3 +17,4 @@ num_cpus: 1
# extra args for virt-install # extra args for virt-install
virt_install_os_args: --cdrom https://www.foo.sh/ks/openbsd/openbsd.iso virt_install_os_args: --cdrom https://www.foo.sh/ks/openbsd/openbsd.iso
virt_install_python_cmd: pkg_add python3 -I -x

View file

@ -137,3 +137,10 @@
with_items: "{{ hostkeys.stdout.splitlines() }}" with_items: "{{ hostkeys.stdout.splitlines() }}"
delegate_to: localhost delegate_to: localhost
when: inventory_hostname not in result.list_vms when: inventory_hostname not in result.list_vms
- name: install python if required
command: "ssh {{ inventory_hostname }} '{{ virt_install_python_cmd }}'"
delegate_to: localhost
when:
- inventory_hostname not in result.list_vms
- virt_install_python_cmd is defined