homeassistant: Install newer python version if required

This commit is contained in:
Thomas Basler 2024-10-02 21:59:04 +02:00
parent 389331e59a
commit b629b62974
4 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,3 @@
---
ha_python_version: '3.12'

View File

@ -1 +1,5 @@
--- ---
- name: Install python if required
ansible.builtin.include_tasks: python_312.yml
when: ha_python_version == '3.12'

View File

@ -0,0 +1,26 @@
---
- name: Python 3.12 | add GPG signing key
become: true
ansible.builtin.apt_key:
url: "https://pascalroeleven.nl/deb-pascalroeleven.gpg"
state: present
validate_certs: true
tags: install
- name: Python 3.12 | add official repository
become: true
ansible.builtin.apt_repository:
repo: "deb http://deb.pascalroeleven.nl/python3.12 bookworm-backports main"
state: present
filename: python312
update_cache: true
tags: install
- name: Python 3.12 | establish dependencies
become: true
ansible.builtin.apt:
name: "{{ item }}"
state: present
loop: "{{ python312_dependencies }}"
tags: install

View File

@ -0,0 +1,6 @@
---
python312_dependencies:
- python3.12
- python3.12-venv
- python3.12-dev