Skip to content

Commit e8d6628

Browse files
committed
Fix any_erros_fatal and pcs resource move
1 parent 611535d commit e8d6628

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

tasks/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,7 @@
977977
- "{{ ansible_failed_result.stdout_lines }}"
978978

979979
- name: Configure for high availability
980+
any_errors_fatal: true
980981
when: mssql_ha_configure | bool
981982
block:
982983
# Required for configure_ag.j2 to set WRITE_LEASE_VALIDITY based on
@@ -1071,7 +1072,6 @@
10711072
{%- endif -%}
10721073
10731074
- name: Configure availability group on the primary node
1074-
any_errors_fatal: true
10751075
when: mssql_ha_replica_type == 'primary'
10761076
block:
10771077
- name: Ensure the package {{ __mssql_server_ha_packages }}
@@ -1143,7 +1143,6 @@
11431143
# In the case of fail over the primary replica moves to a different server.
11441144
# This block identifies the current primary replica and works on it.
11451145
- name: Configure availability group on the current primary replica
1146-
any_errors_fatal: true
11471146
block:
11481147
- name: Get the current primary replica in SQL
11491148
vars:

tests/tests_configure_ha_cluster_external.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,13 @@
216216
that: "'Started' in __pcs_status_virtualip.stdout"
217217

218218
- name: Move the virtualip resource
219-
command: pcs resource move virtualip
219+
command: >-
220+
pcs resource move
221+
{% if (ansible_distribution in ['CentOS', 'RedHat']) and
222+
(ansible_distribution_major_version is version('9', '>=')) %}
223+
move-with-constraint
224+
{% endif %}
225+
virtualip
220226
register: __pcs_move
221227
run_once: true
222228
changed_when: true

0 commit comments

Comments
 (0)