Skip to content

Commit

Permalink
ha_cluster_fence_agent_packages defaults update
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelmamula authored and richm committed Feb 9, 2024
1 parent 5da177d commit b8de4f5
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 22 deletions.
4 changes: 3 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ ha_cluster_start_on_boot: true

ha_cluster_extra_packages: []

ha_cluster_fence_agent_packages: []
# Default fence agent packages are defined in respective os_family var files
ha_cluster_fence_agent_packages:
"{{ __ha_cluster_fence_agent_packages_default }}"

ha_cluster_hacluster_password: ""
ha_cluster_regenerate_keys: false
Expand Down
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_final
('fence-virt' in ha_cluster_fence_agent_packages
or 'fence-virt' in ha_cluster_extra_packages
or 'fence-agents-all' in __ha_cluster_fence_agent_packages_final
or 'fence-agents-all' in ha_cluster_fence_agent_packages
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
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
+
ha_cluster_sbd_enabled | ternary(__ha_cluster_sbd_packages, [])
+
__ha_cluster_fence_agent_packages_final }}"
ha_cluster_fence_agent_packages }}"
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_final
'fence-virt' in ha_cluster_fence_agent_packages
or
'fence-virt' in ha_cluster_extra_packages
or
'fence-agents-all' in __ha_cluster_fence_agent_packages_final
'fence-agents-all' in ha_cluster_fence_agent_packages
or
'fence-agents-all' in ha_cluster_extra_packages
)
Expand Down
8 changes: 0 additions & 8 deletions tasks/shell_crmsh/check-and-prepare-role-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,3 @@
- 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: 0 additions & 8 deletions tasks/shell_pcs/check-and-prepare-role-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,3 @@
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) }}"

0 comments on commit b8de4f5

Please sign in to comment.