summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-07-16 11:03:17 +0200
committerAhmed Abdelhalim <[email protected]>2026-07-16 11:03:17 +0200
commitf79d1d829cdafebb5dbcd658d31ae89f2e53ce73 (patch)
treee48d3e5807b35b9511b2d00904d35c751f7616d0
parentff254e3acaef4ed39080836e6886dca5cee38c10 (diff)
Add python3 to lxc containers to enable ansible provisioning
-rw-r--r--roles/pve-lxc/tasks/main.yml17
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"