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

sap_general_preconfigure: Revert to ignoring DNS failures #785

Merged
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
4 changes: 4 additions & 0 deletions roles/sap_general_preconfigure/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ sap_general_preconfigure_kernel_parameters: "{{ __sap_general_preconfigure_kerne
sap_general_preconfigure_max_hostname_length: '13'
# The maximum length of the hostname. See SAP note 611361.

sap_general_preconfigure_ignore_dns_failures: true
# Set to `false` for failing the role if one of the DNS name resolution check fails. The default is to
# report such errors and continue running the role.

# If "global" variables are set, use those. If not, default to the values from gather_facts:
sap_general_preconfigure_ip: "{{ sap_ip | d(ansible_default_ipv4.address) }}"
# The IPV4 address to be used for updating or checking `/etc/hosts` entries.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# SPDX-License-Identifier: Apache-2.0
---

- name: "Verify the correct DNS hostname to IP address resolution (A record) for {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}"
- name: "Verify the correct DNS hostname to IP address resolution (A record)"
ansible.builtin.shell: test "$(dig {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }} +short)" = "{{ sap_general_preconfigure_ip }}"
changed_when: false
register: __sap_general_preconfigure_register_dns_test_a
failed_when: __sap_general_preconfigure_register_dns_test_a.rc != 0
ignore_errors: "{{ sap_general_preconfigure_ignore_dns_failures | d(true) }}"

### BUG: dig does not use search path in resolv.conf on PPCle
- name: "Verify the correct DNS hostname to IP address resolution (A record) using the hostname and the search list for {{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}"
- name: "Verify the correct DNS hostname to IP address resolution (A record) using hostname and search list"
ansible.builtin.shell: test "$(dig {{ sap_general_preconfigure_hostname }} +search +short)" = "{{ sap_general_preconfigure_ip }}"
changed_when: false
register: __sap_general_preconfigure_register_dns_test_searchlist
failed_when: __sap_general_preconfigure_register_dns_test_searchlist.rc != 0
ignore_errors: "{{ sap_general_preconfigure_ignore_dns_failures | d(true) }}"

- name: "Verify the correct DNS IP address to FQDN resolution (PTR record) for {{ sap_general_preconfigure_ip }}"
- name: "Verify the correct DNS IP address to FQDN resolution (PTR record)"
ansible.builtin.shell: test "$(dig -x {{ sap_general_preconfigure_ip }} +short)" = "{{ sap_general_preconfigure_hostname }}.{{ sap_general_preconfigure_domain }}."
changed_when: false
register: __sap_general_preconfigure_register_dns_test_ptr
failed_when: __sap_general_preconfigure_register_dns_test_ptr.rc != 0
ignore_errors: "{{ sap_general_preconfigure_ignore_dns_failures | d(true) }}"
Loading