Skip to content
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

fix 1.3.4 #36

Merged
merged 2 commits into from
Apr 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions runner/ansible/roles/checks/1.3.4/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,26 @@

- name: "{{ name }}.check"
shell: |
sbdarray=$(grep -E '^SBD_DEVICE=' /etc/sysconfig/sbd | grep -oP 'SBD_DEVICE=\K[^.]+' | sed 's/\"//g')
IFS=';' sbdarray=( $sbdarray )
# convoluted, but normal count method does not work with jinja2
# issue: https://github.com/ansible/ansible/issues/16968
temp_ar=(${!sbdarray[@]}); device_count=`expr ${temp_ar[-1]} + 1`
echo "$device_count"
#!/bin/bash
file="/etc/sysconfig/sbd"
source "$file" || exit 1
COUNT=$(perl -e '
my $sbd_device="'$SBD_DEVICE'";
my $count;
my @paths=split(";", $sbd_device);
if ( $paths[-1] ne "" ) {
$count = $#paths + 1;
} else {
$count = $#paths;
}
printf "%i\n", $count
')
[[ "${COUNT}" == {{ expected[name] }} ]] && exit 0
exit 1
check_mode: false
register: config_updated
changed_when: config_updated.stdout != expected[name]
changed_when: config_updated.rc != 0
failed_when: config_updated.rc > 1

- block:
- name: Post results
Expand Down
2 changes: 1 addition & 1 deletion runner/ansible/vars/dev/10-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ expected_core:
"1.2.2.fence_azure_arm": "" # doesn't apply
"1.3.1": "yes"
"1.3.2": "clean"
"1.3.4": "1"
"1.3.4": "3"
"1.3.5": "15"
"1.3.6": "30"
"2.2.1": "SLES_SAP"
Expand Down