feat(longhorn): update API versions to v1beta2 and add python3.14 venv support
- Update Longhorn Node API versions from v1beta1 to v1beta2 in disk management tasks - Add venv_path configuration and set ansible_python_interpreter to use virtual environment - Introduce python3.14-venv.yml task and python314_venv role for Python virtual environment setup
This commit is contained in:
parent
5b728bf3e0
commit
6eb920ae0d
6 changed files with 76 additions and 7 deletions
|
|
@ -5,3 +5,4 @@ ansible_become: true
|
|||
#ansible_become_method: sudo
|
||||
#ansible_become_pass: "{{ lookup('env', 'ANSIBLE_BECOME_PASS') | default(omit) }}"
|
||||
k8s_version: "1.36"
|
||||
venv_path: "/home/{{ ansible_user }}/.venv"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
---
|
||||
ansible_python_interpreter: "{{ venv_path }}/bin/python"
|
||||
|
||||
longhorn_chart_version: "1.12.0"
|
||||
longhorn_namespace: longhorn-system
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
- name: Disks | Register dedicated disk on Longhorn node
|
||||
kubernetes.core.k8s_json_patch:
|
||||
api_version: longhorn.io/v1beta1
|
||||
api_version: longhorn.io/v1beta2
|
||||
kind: Node
|
||||
namespace: "{{ longhorn_namespace }}"
|
||||
name: "{{ item.node }}"
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
- name: Disks | Get current disk spec for each worker node
|
||||
kubernetes.core.k8s_info:
|
||||
api_version: longhorn.io/v1beta1
|
||||
api_version: longhorn.io/v1beta2
|
||||
kind: Node
|
||||
namespace: "{{ longhorn_namespace }}"
|
||||
name: "{{ item }}"
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
|
||||
- name: Disks | Disable auto-created default disk (required before removal)
|
||||
kubernetes.core.k8s_json_patch:
|
||||
api_version: longhorn.io/v1beta1
|
||||
api_version: longhorn.io/v1beta2
|
||||
kind: Node
|
||||
namespace: "{{ longhorn_namespace }}"
|
||||
name: "{{ item.item }}"
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
|
||||
- name: Disks | Remove auto-created default disk
|
||||
kubernetes.core.k8s_json_patch:
|
||||
api_version: longhorn.io/v1beta1
|
||||
api_version: longhorn.io/v1beta2
|
||||
kind: Node
|
||||
namespace: "{{ longhorn_namespace }}"
|
||||
name: "{{ item.item }}"
|
||||
|
|
@ -124,7 +124,7 @@
|
|||
|
||||
- name: Disks | Get current disk spec for control_plane nodes
|
||||
kubernetes.core.k8s_info:
|
||||
api_version: longhorn.io/v1beta1
|
||||
api_version: longhorn.io/v1beta2
|
||||
kind: Node
|
||||
namespace: "{{ longhorn_namespace }}"
|
||||
name: "{{ item }}"
|
||||
|
|
@ -138,7 +138,7 @@
|
|||
|
||||
- name: Disks | Disable auto-created default disk on control_plane nodes
|
||||
kubernetes.core.k8s_json_patch:
|
||||
api_version: longhorn.io/v1beta1
|
||||
api_version: longhorn.io/v1beta2
|
||||
kind: Node
|
||||
namespace: "{{ longhorn_namespace }}"
|
||||
name: "{{ item.item }}"
|
||||
|
|
@ -161,7 +161,7 @@
|
|||
|
||||
- name: Disks | Remove auto-created default disk from control_plane nodes
|
||||
kubernetes.core.k8s_json_patch:
|
||||
api_version: longhorn.io/v1beta1
|
||||
api_version: longhorn.io/v1beta2
|
||||
kind: Node
|
||||
namespace: "{{ longhorn_namespace }}"
|
||||
name: "{{ item.item }}"
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@
|
|||
- name: SELinux patch
|
||||
ansible.builtin.include_tasks: selinux.yml
|
||||
|
||||
- name: Install python3.14 Virtual Environment
|
||||
ansible.builtin.include_tasks: python3.14-venv.yml
|
||||
|
||||
- name: Disks
|
||||
ansible.builtin.include_tasks: disks.yml
|
||||
when: longhorn_disks | default([]) | length > 0
|
||||
|
|
|
|||
39
roles/longhorn_prereqs/tasks/python3.14-venv.yml
Normal file
39
roles/longhorn_prereqs/tasks/python3.14-venv.yml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
- name: Install Python 3.14 and pip
|
||||
ansible.builtin.dnf:
|
||||
name:
|
||||
- python3.14
|
||||
- python3.14-pip
|
||||
state: present
|
||||
|
||||
- name: Verify Python 3.14 installation
|
||||
ansible.builtin.command: python3.14 --version
|
||||
register: _python_version
|
||||
changed_when: false
|
||||
|
||||
- name: Create virtual environment
|
||||
ansible.builtin.command: python3.14 -m venv {{ venv_path }}
|
||||
args:
|
||||
creates: "{{ venv_path }}/bin/activate"
|
||||
when: venv_path is defined
|
||||
|
||||
- name: Upgrade pip in virtual environment
|
||||
ansible.builtin.pip:
|
||||
name: pip
|
||||
state: latest
|
||||
executable: "{{ venv_path }}/bin/pip"
|
||||
when: venv_path is defined
|
||||
|
||||
- name: Install oauthlib in virtual environment
|
||||
ansible.builtin.pip:
|
||||
name: oauthlib
|
||||
state: latest
|
||||
executable: "{{ venv_path }}/bin/pip"
|
||||
when: venv_path is defined
|
||||
|
||||
- name: Install kubernetes in virtual environment
|
||||
ansible.builtin.pip:
|
||||
name: kubernetes
|
||||
state: latest
|
||||
executable: "{{ venv_path }}/bin/pip"
|
||||
when: venv_path is defined
|
||||
24
roles/python314_venv/tasks/main.yml
Normal file
24
roles/python314_venv/tasks/main.yml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
- name: Install Python 3.14 and pip
|
||||
ansible.builtin.dnf:
|
||||
name:
|
||||
- python3.14
|
||||
- python3.14-pip
|
||||
state: present
|
||||
|
||||
- name: Verify Python 3.14 installation
|
||||
ansible.builtin.command: python3.14 --version
|
||||
register: _python_version
|
||||
changed_when: false
|
||||
|
||||
- name: Create virtual environment
|
||||
ansible.builtin.command: python3.14 -m venv {{ venv_path }}
|
||||
args:
|
||||
creates: "{{ venv_path }}/bin/activate"
|
||||
when: venv_path is defined
|
||||
|
||||
- name: Upgrade pip in virtual environment
|
||||
ansible.builtin.pip:
|
||||
executable: "{{ venv_path }}/bin/pip"
|
||||
upgrade: true
|
||||
when: venv_path is defined
|
||||
Loading…
Reference in a new issue