forked from redhat-partner-solutions/crucible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With some record configurations dig will return more than one line which broke the previous approch. Is stead we now check for an expected value being present in the returned string.
- Loading branch information
1 parent
b730868
commit 751b443
Showing
3 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
required_domains: | ||
- "{{ 'api.' + domain }}" | ||
- "{{ 'api-int.' + domain }}" | ||
- "{{ '*.apps.' + domain }}" | ||
"api": "api.{{ domain }}" | ||
"api-int": "api-int.{{ domain }}" | ||
"apps": "*.apps.{{ domain }}" | ||
|
||
expected_answers: | ||
"api": "{{ api_vip }}" | ||
"api-int": "{{ api_vip }}" | ||
"apps": "{{ ingress_vip }}" | ||
|
||
required_binary: dig | ||
required_binary_provided_in_package: bind-utils | ||
domain: "{{ cluster_name }}.{{ base_dns_domain }}" | ||
domain: "{{ cluster_name }}.{{ base_dns_domain }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
- name: Check required domain {item} exists | ||
ansible.builtin.shell: | ||
cmd: "{{ required_binary }} {{ item.value }} +short" | ||
register: res | ||
changed_when: false | ||
|
||
- name: Check stdout for expected IP address | ||
ansible.builtin.set_fact: | ||
failed_domains: "{{ (failed_domains | default({})) | combine( | ||
{item.value: { | ||
'stdout': res.stdout, | ||
'stderr': res.stderr, | ||
'expected': expected_answers[item.key], | ||
}} | ||
) }}" | ||
when: expected_answers[item.key] not in res.stdout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters