From f79d1d829cdafebb5dbcd658d31ae89f2e53ce73 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Thu, 16 Jul 2026 11:03:17 +0200 Subject: Add python3 to lxc containers to enable ansible provisioning --- roles/pve-lxc/tasks/main.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'roles') diff --git a/roles/pve-lxc/tasks/main.yml b/roles/pve-lxc/tasks/main.yml index c5599751..c0fd0c17 100644 --- a/roles/pve-lxc/tasks/main.yml +++ b/roles/pve-lxc/tasks/main.yml @@ -51,3 +51,20 @@ tags: # PVE API not available in containers — requires proxmox-ve package - "molecule-notest" + +- name: "Bootstrap python3 for ansible" + become: true + ansible.builtin.command: + cmd: > + pct exec {{ pve_lxc_id }} -- sh -c + 'which python3 > /dev/null 2>&1 && exit 0; + . /etc/os-release; + case $ID in + alpine) apk add --no-cache python3 ;; + debian|ubuntu) apt-get install -y python3 ;; + *) echo "Unsupported distro: $ID" && exit 1 ;; + esac' + changed_when: false + tags: + # PVE API not available in containers — requires proxmox-ve package + - "molecule-notest" -- cgit v1.2.3