This repository has been archived by the owner on Mar 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from berndfinger/bz1891642
solve issues #38, 91, 96...102, 104, 106...111
- Loading branch information
Showing
79 changed files
with
2,044 additions
and
251 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
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
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,9 +1,40 @@ | ||
--- | ||
# handlers file for sap-preconfigure | ||
|
||
- name: "Reboot handler" | ||
- name: Reboot the managed node | ||
reboot: | ||
test_command: /bin/true | ||
listen: __sap_preconfigure_reboot_handler | ||
when: | ||
- sap_preconfigure_reboot_ok|d(false) | ||
|
||
- name: Let the role fail if a reboot is required | ||
fail: | ||
msg: Reboot is required! | ||
when: sap_preconfigure_fail_if_reboot_required|d(true) | ||
listen: __sap_preconfigure_reboot_handler | ||
when: | ||
- sap_preconfigure_fail_if_reboot_required|d(true) | ||
- not sap_preconfigure_reboot_ok|d(false) | ||
|
||
- name: Show a warning message if a reboot is required | ||
debug: | ||
msg: "WARN: Reboot is required!" | ||
listen: __sap_preconfigure_reboot_handler | ||
when: | ||
- not sap_preconfigure_fail_if_reboot_required|d(true) | ||
- not sap_preconfigure_reboot_ok|d(false) | ||
|
||
- name: Remount /dev/shm | ||
command: bash -lc "mount -o remount /dev/shm" | ||
listen: __sap_preconfigure_mount_tmpfs_handler | ||
|
||
- name: Check if /dev/shm is available | ||
command: bash -lc "df -h /dev/shm" | ||
register: shell_result | ||
listen: __sap_preconfigure_mount_tmpfs_handler | ||
|
||
- debug: | ||
var: shell_result.stdout_lines, shell_result.stderr_lines | ||
listen: __sap_preconfigure_mount_tmpfs_handler | ||
|
||
... |
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,80 @@ | ||
--- | ||
|
||
- debug: | ||
msg: "imported RedHat/generic/assert-dns-name-resolution.yml" | ||
|
||
- debug: | ||
msg: | ||
- "sap_hostname = {{ sap_hostname }}" | ||
- "sap_domain = {{ sap_domain }}" | ||
- "sap_ip = {{ sap_ip }}" | ||
|
||
- name: Assert that the DNS domain is set | ||
assert: | ||
that: | ||
- not( (ansible_domain is undefined) or (ansible_domain is none) or (ansible_domain | trim == '') ) | ||
fail_msg: "FAIL: The DNS domain is not configured! So variable 'sap_domain' needs to be configured!" | ||
success_msg: "PASS: The DNS domain is configured." | ||
# ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(false) }}" | ||
ignore_errors: yes | ||
|
||
- name: Assert that variable sap_domain is set | ||
assert: | ||
that: | ||
- not( (sap_domain is undefined) or (sap_domain is none) or (sap_domain | trim == '') ) | ||
fail_msg: "FAIL: The variable 'sap_domain' is not set!" | ||
success_msg: "PASS: The variable 'sap_domain' is set." | ||
ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(false) }}" | ||
|
||
- name: Check if IP address for sap_hostname.sap_domain is resolved correctly | ||
shell: dig {{ sap_hostname }}.{{ sap_domain }} +short | ||
register: dig_short_result | ||
ignore_errors: yes | ||
changed_when: no | ||
|
||
- name: Assert that ansible_default_ipv4.address is set | ||
assert: | ||
that: | ||
- not( (ansible_default_ipv4.address is undefined) or (ansible_default_ipv4.address is none) or (ansible_default_ipv4.address | trim == '') ) | ||
fail_msg: "FAIL: The variable 'ansible_default_ipv4.address' is not defined!" | ||
success_msg: "PASS: The variable 'ansible_default_ipv4.address' is defined." | ||
ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(false) }}" | ||
|
||
- name: Assert that sap_ip is set | ||
assert: | ||
that: | ||
- dig_short_result.stdout == '{{ sap_ip }}' | ||
fail_msg: "FAIL: The variable 'sap_ip' is not set!" | ||
success_msg: "PASS: The variable 'sap_ip' is set." | ||
ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(false) }}" | ||
|
||
### BUG: dig does not use search path in resolv.con on PPCle | ||
- name: Check if IP address for sap_hostname with search path is resolved correctly | ||
shell: dig {{ sap_hostname }} +search +short | ||
register: dig_search_short_result | ||
changed_when: false | ||
ignore_errors: true | ||
|
||
- name: Assert that the IP address for sap_hostname is resolved correctly | ||
assert: | ||
that: | ||
- dig_search_short_result.stdout == '{{ sap_ip }}' | ||
fail_msg: "FAIL: The IP address for 'sap_hostname' could not be resolved!" | ||
success_msg: "PASS: The IP address for 'sap_hostname' was resolved." | ||
ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(true) }}" | ||
|
||
- name: Check if the reverse name resolution is correct | ||
shell: dig -x {{ sap_ip }} +short | ||
register: dig_reverse_result | ||
changed_when: false | ||
ignore_errors: true | ||
|
||
- name: Assert that the reverse name resolution is correct | ||
assert: | ||
that: | ||
- dig_reverse_result.stdout == '{{ sap_hostname }}.{{ sap_domain }}.' | ||
fail_msg: "FAIL: The reverse name resolution of 'sap_ip' was not successful!" | ||
success_msg: "PASS: The reverse name resolution of 'sap_ip' was successful." | ||
ignore_errors: "{{ sap_preconfigure_assert_ignore_errors|d(true) }}" | ||
|
||
... |
Oops, something went wrong.