56 lines
2.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
# Main entrypoint for proxmox_post_install role
- name: "Check that role is enabled"
ansible.builtin.meta: end_play
when: not proxmox_post_install_enabled
- name: "Detect Proxmox VE version (pveversion)"
ansible.builtin.command: "pveversion"
register: proxmox_pveversion_cmd
changed_when: false
- name: "Parse Proxmox VE version"
ansible.builtin.set_fact:
proxmox_pve_version_full: "{{ proxmox_pveversion_cmd.stdout | trim }}"
# pveversion output: "pve-manager/9.1.1/42db4a6cf33dac83" - version is at index 1
proxmox_pve_version: "{{ (proxmox_pveversion_cmd.stdout | trim).split('/')[1] }}"
proxmox_pve_major: "{{ (proxmox_pveversion_cmd.stdout | trim).split('/')[1].split('.')[0] | int }}"
proxmox_pve_minor: "{{ (proxmox_pveversion_cmd.stdout | trim).split('/')[1].split('.')[1] | int }}"
- name: "Fail if Proxmox VE major version is unsupported"
ansible.builtin.fail:
msg: >-
Unsupported Proxmox VE major version: {{ proxmox_pve_major }}.
Supported: 8.08.9.x and 9.09.1.x (mirrors upstream post-pve-install.sh).
when: proxmox_pve_major not in proxmox_supported_major_versions
- name: "Fail if Proxmox VE 8 minor version unsupported"
ansible.builtin.fail:
msg: >-
Unsupported Proxmox 8 version {{ proxmox_pve_version }}.
Supported minor range: {{ proxmox_8_min_minor }}{{ proxmox_8_max_minor }}.
when:
- proxmox_pve_major == 8
- proxmox_pve_minor < proxmox_8_min_minor or proxmox_pve_minor > proxmox_8_max_minor
- name: "Fail if Proxmox VE 9 minor version unsupported"
ansible.builtin.fail:
msg: >-
Unsupported Proxmox 9 version {{ proxmox_pve_version }}.
Supported minor range: {{ proxmox_9_min_minor }}{{ proxmox_9_max_minor }}.
when:
- proxmox_pve_major == 9
- proxmox_pve_minor < proxmox_9_min_minor or proxmox_pve_minor > proxmox_9_max_minor
- name: "Include version-specific tasks for PVE 8"
ansible.builtin.import_tasks: pve8.yml
when: proxmox_pve_major == 8
- name: "Include version-specific tasks for PVE 9"
ansible.builtin.import_tasks: pve9.yml
when: proxmox_pve_major == 9
- name: "Common post-routines (nag, HA, update, reboot)"
ansible.builtin.import_tasks: post_common.yml