diff --git a/README.md b/README.md index 6680d75..0c7b741 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ha-cluster-pacemaker ========= -Role for configuring and expanding basic pacemaker cluster on CentOS/RHEL 6/7/8, Fedora 31/32/33 and CentOS 8 Stream systems. +Role for configuring and expanding basic pacemaker cluster on CentOS/RHEL 6/7/8, AlmaLinux 8, Fedora 31/32/33 and CentOS 8 Stream systems. This role can configure following aspects of pacemaker cluster: - enable needed system repositories @@ -131,7 +131,7 @@ Role Variables cluster_configure_stonith_style: 'one-device-per-node' ``` - - (RHEL/CentOS) enable the repositories containing needed packages + - (RHEL/CentOS/AlmaLinux) enable the repositories containing needed packages ``` enable_repos: true ``` diff --git a/tasks/almalinux_repos.yml b/tasks/almalinux_repos.yml new file mode 100644 index 0000000..fee96b9 --- /dev/null +++ b/tasks/almalinux_repos.yml @@ -0,0 +1,21 @@ +--- +- name: get list of active repositories + command: yum repolist + args: + warn: false + register: yum_repolist + changed_when: false + check_mode: false + +- name: enable highavailability repository (AlmaLinux 8.3+) + ini_file: + dest: '/etc/yum.repos.d/almalinux-ha.repo' + section: 'ha' + option: 'enabled' + value: '1' + create: 'no' + mode: '0644' + when: >- + 'HighAvailability' not in yum_repolist.stdout + and enable_repos | bool + and ansible_distribution_major_version in ['8'] diff --git a/tasks/install_normal.yml b/tasks/install_normal.yml index cfa55d9..09bdacb 100644 --- a/tasks/install_normal.yml +++ b/tasks/install_normal.yml @@ -4,7 +4,7 @@ name: 'libselinux-python' state: 'installed' when: - - not (ansible_distribution in ['RedHat','CentOS'] and ansible_distribution_major_version == '8') + - not (ansible_distribution in ['RedHat','CentOS','AlmaLinux'] and ansible_distribution_major_version == '8') - not (ansible_distribution == 'Fedora' and ansible_distribution_major_version >= '31') - name: Install Pacemaker cluster packages to all nodes diff --git a/tasks/main.yml b/tasks/main.yml index 1e9eebe..0eda4f5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -97,11 +97,11 @@ enabled: true state: 'started' -- name: Setup firewall for RHEL/CentOS systems +- name: Setup firewall for RHEL/CentOS/AlmaLinux systems include_tasks: "firewall-el{{ ansible_distribution_major_version }}.yml" when: - cluster_firewall|bool - - ansible_distribution == 'RedHat' or ansible_distribution == 'CentOS' + - ansible_distribution in ['RedHat','CentOS','AlmaLinux'] - name: Setup firewall for Fedora systems include_tasks: "firewall-fedora.yml"