---
- name: Test LVM shared pools
  hosts: all
  become: true

  tasks:
    - name: Create cluster
      ansible.builtin.include_role:
        name: fedora.linux_system_roles.ha_cluster
      vars:
        ha_cluster_cluster_name: rhel9-1node
        # Users should vault-encrypt the password
        ha_cluster_hacluster_password: hapasswd
        ha_cluster_extra_packages:
          - dlm
          - lvm2-lockd
        ha_cluster_cluster_properties:
          - attrs:
              # Don't do this in production
              - name: stonith-enabled
                value: 'false'
        ha_cluster_resource_primitives:
          - id: dlm
            agent: 'ocf:pacemaker:controld'
            instance_attrs:
              - attrs:
                  # Don't do this in production
                  - name: allow_stonith_disabled
                    value: 'true'
          - id: lvmlockd
            agent: 'ocf:heartbeat:lvmlockd'
        ha_cluster_resource_groups:
          - id: locking
            resource_ids:
              - dlm
              - lvmlockd
