--- # tasks file for linstor_install - name: Install Proxmox kernel headers ansible.builtin.apt: name: - "proxmox-headers-{{ ansible_facts['kernel'] }}" - proxmox-default-headers state: present update_cache: true - name: Install LINSTOR, DRBD, and LVM dependencies ansible.builtin.apt: name: - drbd-dkms - drbd-utils - lvm2 - thin-provisioning-tools - linstor-satellite - linstor-proxmox - linstor-controller - linstor-client - drbd-reactor state: present - name: Check currently loaded DRBD version ansible.builtin.shell: cat /proc/drbd || true register: linstor_install_drbd_version changed_when: false - name: Eject legacy DRBD 8.4 module if present community.general.modprobe: name: drbd state: absent when: "'version: 8' in linstor_install_drbd_version.stdout" - name: Ensure DRBD kernel module is loaded community.general.modprobe: name: drbd state: present - name: Enable and start base services (Satellite & Reactor) ansible.builtin.systemd: name: "{{ item }}" enabled: true state: started loop: - linstor-satellite - drbd-reactor - name: Ensure LINSTOR Controller is disabled safely on all nodes ansible.builtin.systemd: name: linstor-controller enabled: false state: stopped - name: Enable and start LINSTOR Controller strictly on Node 1 ansible.builtin.systemd: name: linstor-controller enabled: true state: started # Ansible Magic: This dynamically targets the very first node listed in your inventory under the 'proxmox' group! when: inventory_hostname == groups['proxmox'][0]