# SPDX-License-Identifier: MIT
---
- name: Minimal cluster configuration, daemons disabled
  hosts: all
  vars_files: vars/main.yml
  vars:
    ha_cluster_cluster_name: test-cluster
    ha_cluster_start_on_boot: false

  tasks:
    - name: Run test
      tags: tests::verify
      block:
        - name: Set up test environment
          include_role:
            name: linux-system-roles.ha_cluster
            tasks_from: test_setup.yml

        - name: Run HA Cluster role
          include_role:
            name: linux-system-roles.ha_cluster
            public: true

        - name: Get services status
          service_facts:

        - name: Check services status
          assert:
            that:
              - ansible_facts.services["pcsd.service"].status == "enabled"
              - ansible_facts.services["corosync.service"].status == "disabled"
              - ansible_facts.services["pacemaker.service"].status == "disabled"

        - name: Assert cluster status
          include_tasks: tasks/assert_cluster_running.yml

        - name: Check firewall and selinux state
          include_tasks: tasks/check_firewall_selinux.yml
