Added support for single-node setups
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
any_errors_fatal: true
|
||||
|
||||
vars:
|
||||
# Dynamically detect if we are in Single-Node or Cluster mode
|
||||
is_single_node: "{{ groups['proxmox'] | length == 1 }}"
|
||||
|
||||
# Existing clustering variables
|
||||
corosync_ip: "{{ priv_ip | default(ansible_host) }}"
|
||||
master_corosync_ip: "{{ hostvars[groups['proxmox'][0]]['priv_ip'] | default(hostvars[groups['proxmox'][0]]['ansible_host']) }}"
|
||||
is_master: "{{ inventory_hostname == groups['proxmox'][0] }}"
|
||||
@@ -33,10 +37,12 @@
|
||||
state: "{{ 'absent' if pve_enterprise_key | length > 0 else 'present' }}"
|
||||
filename: pve-no-subscription
|
||||
|
||||
- name: Add Linstor Repositories
|
||||
- name: Add Linstor Repositories (Skipped in Single Node)
|
||||
ansible.builtin.include_role:
|
||||
name: linstor_repo
|
||||
when: deploy_linstor | bool
|
||||
when:
|
||||
- deploy_linstor | bool
|
||||
- not is_single_node | bool
|
||||
|
||||
# ==========================================
|
||||
# PHASE 2: UPDATES & NAG REMOVAL
|
||||
@@ -55,10 +61,12 @@
|
||||
replace: "void({ //\\1"
|
||||
notify: Restart pveproxy
|
||||
|
||||
- name: Install Linstor Packages
|
||||
- name: Install Linstor Packages (Skipped in Single Node)
|
||||
ansible.builtin.include_role:
|
||||
name: linstor_install
|
||||
when: deploy_linstor | bool
|
||||
when:
|
||||
- deploy_linstor | bool
|
||||
- not is_single_node | bool
|
||||
|
||||
- name: Reboot if kernel was updated
|
||||
ansible.builtin.reboot:
|
||||
@@ -68,6 +76,9 @@
|
||||
# ==========================================
|
||||
# PHASE 3: PROXMOX CLUSTERING
|
||||
# ==========================================
|
||||
- name: PROXMOX CLUSTERING (Skipped in Single Node Mode)
|
||||
when: not is_single_node | bool
|
||||
block:
|
||||
- name: Ensure SSH keypair exists for root
|
||||
ansible.builtin.user:
|
||||
name: root
|
||||
@@ -127,8 +138,10 @@
|
||||
# ==========================================
|
||||
# PHASE 4: LINSTOR CONFIGURATION
|
||||
# ==========================================
|
||||
- name: Configure Linstor (Skipped if deploy_linstor=false)
|
||||
when: deploy_linstor | bool
|
||||
- name: LINSTOR CONFIGURATION (Skipped if deploy_linstor=false or Single Node)
|
||||
when:
|
||||
- deploy_linstor | bool
|
||||
- not is_single_node | bool
|
||||
block:
|
||||
- name: Configure Linstor Cluster
|
||||
ansible.builtin.include_role:
|
||||
|
||||
Reference in New Issue
Block a user