-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add conditional failure for 12sp5 AWS fencing #257
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -222,6 +222,16 @@ | |||||
migration_threshold: "{{ (crm_rsc_options_show.stdout | regex_search('migration-threshold=([0-9]*)', '\\1'))[0] | default('false') }}" | ||||||
op_default_timeout: "{{ (crm_op_options_show.stdout | regex_search('timeout=([0-9]*)', '\\1'))[0] | default('false') }}" | ||||||
|
||||||
- name: Set corosync facts | ||||||
ansible.builtin.set_fact: | ||||||
aws_stonith_cmd: | | ||||||
crm configure primitive rsc_aws_stonith stonith:external/ec2 \ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. from optional
|
||||||
op start interval=0 timeout=180 \ | ||||||
op stop interval=0 timeout=180 \ | ||||||
op monitor interval=120 timeout=60 \ | ||||||
meta target-role=Started \ | ||||||
params tag={{ aws_stonith_tag}} pcmk_delay_max=15 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
- name: Enable SBD [sbd] | ||||||
ansible.builtin.command: | ||||||
cmd: crm configure primitive rsc_iscsi_sbd stonith:external/sbd | ||||||
|
@@ -230,18 +240,25 @@ | |||||
- use_sbd | ||||||
- is_primary | ||||||
|
||||||
- name: Configure AWS EC2 STONITH | ||||||
ansible.builtin.command: > | ||||||
crm configure primitive rsc_aws_stonith stonith:external/ec2 | ||||||
op start interval=0 timeout=180 | ||||||
op stop interval=0 timeout=180 | ||||||
op monitor interval=120 timeout=60 | ||||||
meta target-role=Started | ||||||
params tag={{ aws_stonith_tag}} pcmk_delay_max=15 | ||||||
- name: Configure AWS EC2 STONITH for sle 12sp5 | ||||||
ansible.builtin.command: "{{ aws_stonith_cmd }}" | ||||||
when: | ||||||
- is_primary | ||||||
- cloud_platform_is_aws | ||||||
- not (use_sbd | bool) | ||||||
- ansible_distribution_major_version == '12' | ||||||
register: stonith_config_result | ||||||
failed_when: > | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perfect |
||||||
stonith_config_result.stderr_lines | select("match", "ERROR") | reject("match", "ERROR: warning") | list | length > 0 | ||||||
|
||||||
|
||||||
- name: Configure AWS EC2 STONITH for sle 15 | ||||||
ansible.builtin.command: "{{ aws_stonith_cmd }}" | ||||||
when: | ||||||
- is_primary | ||||||
- cloud_platform_is_aws | ||||||
- not (use_sbd | bool) | ||||||
- ansible_distribution_major_version != '12' | ||||||
register: stonith_config_result | ||||||
failed_when: "'ERROR' in stonith_config_result.stderr" | ||||||
mpagot marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
|
@@ -401,7 +418,7 @@ | |||||
when: | ||||||
- is_primary | ||||||
- reg_vip_location.stdout | trim | split(' ') | last != primary_hostname | ||||||
until: reg_vip_location2.stdout_lines[0] | trim | split(' ') | last == primary_hostname | ||||||
until: reg_vip_location2.stdout_lines | length > 0 and reg_vip_location2.stdout_lines[0] | trim | split(' ') | last == primary_hostname | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This addresses Problem 3: it adds a check for output length, so the task retries if the output is not yet ready instead of immediately failing |
||||||
retries: 10 | ||||||
delay: 6 | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.