diff options
| author | Ahmed AbdelHalim <[email protected]> | 2026-07-16 11:03:17 +0200 |
|---|---|---|
| committer | Ahmed AbdelHalim <[email protected]> | 2026-07-16 11:03:17 +0200 |
| commit | 0fdef39264ae465444163f6f311f1ef03c25acce (patch) | |
| tree | e48d3e5807b35b9511b2d00904d35c751f7616d0 | |
| parent | c42a43686dcf4103e1906b2d7cdadb4b3f4aa898 (diff) | |
Add python3 to lxc containers to enable ansible provisioning
| -rw-r--r-- | roles/pve-lxc/tasks/main.yml | 17 |
1 files changed, 17 insertions, 0 deletions
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" |
