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.
This commit is contained in:
Marty Oehme 2025-07-19 08:53:51 +02:00
parent 84d7319465
commit c5448b17cc
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -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