Skip to content

Commit

Permalink
reverted main ordering, moved HAE detection
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelmamula committed Feb 14, 2024
1 parent c33cc43 commit cab069a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
24 changes: 24 additions & 0 deletions tasks/enable-repositories/Suse.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# SPDX-License-Identifier: MIT
---
# All required repositories are already part of SLES for SAP 15 SP5+.

# High Availability Extension is required for cluster setup as well
# as qnetd/qdevice configuration.
- name: Gather package facts
ansible.builtin.package_facts:
manager: auto

- name: Check High Availability Extension presence using product file
ansible.builtin.stat:
path: /etc/products.d/sle-ha.prod
register: __ha_cluster_ha_ext_stat

# Registering HA Extension creates file /etc/products.d/sle-ha.prod and
# installs rpm sle-ha-release. Cluster software is not installed.
- name: Assert that High Availability Extension is present
ansible.builtin.assert:
that:
- "'sle-ha-release' in ansible_facts.packages"
- __ha_cluster_ha_ext_stat.stat.exists
success_msg: "High Availability Extension was detected."
fail_msg: "High Availability Extension is not registered!
Register HA Extension before executing again."
# Fatal fail will occur if any of cluster nodes is missing HAE
any_errors_fatal: true
6 changes: 3 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
when:
- ha_cluster_enable_repos

- name: Check and prepare role variables
include_tasks: shell_{{ ha_cluster_pacemaker_shell }}/check-and-prepare-role-variables.yml # yamllint disable-line rule:line-length

- name: Install role essential packages
package:
name: "{{
Expand All @@ -21,6 +18,9 @@
use: "{{ (__ha_cluster_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"

- name: Check and prepare role variables
include_tasks: shell_{{ ha_cluster_pacemaker_shell }}/check-and-prepare-role-variables.yml # yamllint disable-line rule:line-length

# The user is created by installing pacemaker packages. We just need to set the
# password.
- name: Set hacluster password
Expand Down
24 changes: 0 additions & 24 deletions tasks/shell_crmsh/check-and-prepare-role-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@
---
- name: Check cluster configuration variables
block:
# High Availability Extension is required for cluster setup as well
# as qnetd/qdevice configuration.
- name: Gather package facts
ansible.builtin.package_facts:
manager: auto

- name: Check High Availability Extension presence using product file
ansible.builtin.stat:
path: /etc/products.d/sle-ha.prod
register: __ha_cluster_ha_ext_stat

# Registering HA Extension creates file /etc/products.d/sle-ha.prod and
# installs rpm sle-ha-release. Cluster software is not installed.
- name: Assert that High Availability Extension is present
ansible.builtin.assert:
that:
- "'sle-ha-release' in ansible_facts.packages"
- __ha_cluster_ha_ext_stat.stat.exists
success_msg: "High Availability Extension was detected."
fail_msg: "High Availability Extension is not registered!
Register HA Extension before executing again."
# Fatal fail will occur if any of cluster nodes is missing HAE
any_errors_fatal: true

- name: Fail if passwords are not specified
ansible.builtin.fail:
msg: "{{ item }} must be specified"
Expand Down

0 comments on commit cab069a

Please sign in to comment.