Skip to content

Commit

Permalink
__ha_cluster_fence_agent_packages_final added
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelmamula committed Feb 9, 2024
1 parent 52c1f16 commit 7bdeebe
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tasks/firewall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
# noqa: var-naming[no-role-prefix]
__arch: "{{ ansible_facts['architecture'] }}"
__use_fence_fw_port: "{{ __arch == 'x86_64' and
('fence-virt' in ha_cluster_fence_agent_packages
('fence-virt' in __ha_cluster_fence_agent_packages_final
or 'fence-virt' in ha_cluster_extra_packages
or 'fence-agents-all' in ha_cluster_fence_agent_packages
or 'fence-agents-all' in __ha_cluster_fence_agent_packages_final
or 'fence-agents-all' in ha_cluster_extra_packages) }}"
__fence_fw_port: "{{ [{'port': '1229/tcp', 'state': 'enabled'}]
if __use_fence_fw_port else [] }}"
Expand Down
4 changes: 1 addition & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@
+
ha_cluster_sbd_enabled | ternary(__ha_cluster_sbd_packages, [])
+
ha_cluster_fence_agent_packages
if ha_cluster_fence_agent_packages | length > 0
else __ha_cluster_fence_agent_packages }}"
__ha_cluster_fence_agent_packages_final }}"
state: present
use: "{{ (__ha_cluster_is_ostree | d(false)) |
ternary('ansible.posix.rhel_rpm_ostree', omit) }}"
Expand Down
4 changes: 2 additions & 2 deletions tasks/selinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
when:
- ansible_facts['architecture'] == 'x86_64'
- (
'fence-virt' in ha_cluster_fence_agent_packages
'fence-virt' in __ha_cluster_fence_agent_packages_final
or
'fence-virt' in ha_cluster_extra_packages
or
'fence-agents-all' in ha_cluster_fence_agent_packages
'fence-agents-all' in __ha_cluster_fence_agent_packages_final
or
'fence-agents-all' in ha_cluster_extra_packages
)
Expand Down
8 changes: 8 additions & 0 deletions tasks/shell_crmsh/check-and-prepare-role-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,11 @@
- ha_cluster_quorum.options | d([])
| selectattr('name', 'match', '^auto_tie_breaker$')
| map(attribute='value') | select('in', ['0', 0]) | list | length > 0

# Sets fence agent list from os_familu vars depending on user input.
- name: Set __ha_cluster_fence_agent_packages_final fact
ansible.builtin.set_fact:
__ha_cluster_fence_agent_packages_final:
"{{ (ha_cluster_fence_agent_packages | length == 0) |
ternary(__ha_cluster_fence_agent_packages_default,
ha_cluster_fence_agent_packages) }}"
8 changes: 8 additions & 0 deletions tasks/shell_pcs/check-and-prepare-role-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,11 @@
and not 'pcmk.properties.operation-defaults.multiple'
in __ha_cluster_pcs_capabilities
)

# Sets fence agent list from os_familu vars depending on user input.
- name: Set __ha_cluster_fence_agent_packages_final fact
ansible.builtin.set_fact:
__ha_cluster_fence_agent_packages_final:
"{{ (ha_cluster_fence_agent_packages | length == 0) |
ternary(__ha_cluster_fence_agent_packages_default,
ha_cluster_fence_agent_packages) }}"
2 changes: 1 addition & 1 deletion vars/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ __ha_cluster_services:
- pacemaker

# fence agent list for os_family
__ha_cluster_fence_agent_packages: "{{
__ha_cluster_fence_agent_packages_default: "{{
['fence-agents-all']
+
(['fence-virt'] if ansible_architecture == 'x86_64' else [])
Expand Down
6 changes: 5 additions & 1 deletion vars/Suse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ __ha_cluster_services:
__ha_cluster_crm_shadow: shd

# fence agent list for os_family
__ha_cluster_fence_agent_packages: ['fence-agents']
__ha_cluster_fence_agent_packages_default: ['fence-agents']

# Corosync input for jinja2 template
ha_cluster_corosync_params:

# user override: selinux and firewall roles are currently not supported
ha_cluster_manage_firewall: false
ha_cluster_manage_selinux: false

0 comments on commit 7bdeebe

Please sign in to comment.