From c5448b17cc48a7ce2df98d96dd711be17614a39a Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Sat, 19 Jul 2025 08:53:51 +0200 Subject: [PATCH] site: Bootstrap python for any target Before running the main site playbook or any other tasks, we ensure that python is installed on any host so we can actually connect with ansible. --- site.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/site.yaml b/site.yaml index a1a8f76..eb20d2e 100644 --- a/site.yaml +++ b/site.yaml @@ -1,4 +1,22 @@ --- +# TODO: Add to bootstrapping role / make less dependent on apt-get & debian (python3) +- name: Bootstrap python everywhere + hosts: all + gather_facts: False + become: true + tags: + - system + - bootstrap + tasks: + - name: check for python + ansible.builtin.raw: python3 --version + changed_when: false + failed_when: false + register: pythoncheck + - name: install debian python + ansible.builtin.raw: apt-get update && apt-get install python3 -y + when: pythoncheck.rc == 127 + - name: Prepare incus server host hosts: host_system tasks: @@ -31,6 +49,7 @@ - python3-requests # for docker network - name: Prepare all docker hosted containers + gather_facts: True hosts: instance_system tags: - containers