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

various roles: Fix issue sap-linuxlab#556 for non-assert runs #562

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
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@

- name: "Ensure that the length of the hostname is not longer than 'sap_general_preconfigure_max_hostname_length'"
ansible.builtin.assert:
that: "{{ sap_hostname | length | int }} <= {{ sap_general_preconfigure_max_hostname_length | int }}"
that: (sap_hostname | length | int) <= (sap_general_preconfigure_max_hostname_length | int)
msg: "The length of the hostname is {{ sap_hostname | length | int }} but must be less or equal to {{ sap_general_preconfigure_max_hostname_length }} (variable 'sap_general_preconfigure_max_hostname_length')!"
2 changes: 1 addition & 1 deletion roles/sap_hana_install/tasks/hana_addhosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

- name: SAP HANA Add Hosts - Assert that the additional hosts are not shown in hdblcm --list_systems
ansible.builtin.assert:
that: "'{{ line_item }}' not in __sap_hana_install_register_hdblcm_list_systems.stdout"
that: line_item not in __sap_hana_install_register_hdblcm_list_systems.stdout
fail_msg:
- "FAIL: Host '{{ line_item }}' is already part of system '{{ sap_hana_install_sid }}'"
- "Because of this, the addhost operation will not be performed."
Expand Down
7 changes: 6 additions & 1 deletion roles/sap_hana_install/tasks/hana_exists.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,14 @@
changed_when: no
failed_when: no

- name: SAP HANA Checks - Define new variable for the assertion
ansible.builtin.set_fact:
__sap_hana_install_existing_sapsys_gid: "{{ __sap_hana_install_register_getent_group_sapsys.stdout.split(':')[2] }}"
when: __sap_hana_install_register_getent_group_sapsys.rc == 0

- name: SAP HANA Checks - In case there is a group 'sapsys', assert that its group ID is identical to 'sap_hana_install_groupid'
ansible.builtin.assert:
that: "{{ __sap_hana_install_register_getent_group_sapsys.stdout.split(':')[2] }} == {{ sap_hana_install_groupid }}"
that: (__sap_hana_install_existing_sapsys_gid | int) == (sap_hana_install_groupid | int)
success_msg: "PASS: The group ID of 'sapsys' is identical to the value of variable
sap_hana_install_groupid, which is '{{ sap_hana_install_groupid }}'"
fail_msg: "FAIL: Group 'sapsys' exists but with a different group ID than '{{ sap_hana_install_groupid }}'
Expand Down
2 changes: 1 addition & 1 deletion roles/sap_hana_preconfigure/tasks/RedHat/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

- name: Ensure that the system is running a RHEL release which is supported for SAP HANA
ansible.builtin.assert:
that: ansible_distribution_version in "{{ sap_hana_preconfigure_supported_rhel_minor_releases }}"
that: ansible_distribution_version in sap_hana_preconfigure_supported_rhel_minor_releases
fail_msg: "The RHEL release {{ ansible_distribution_version }} is not supported for SAP HANA!"
success_msg: "The RHEL release {{ ansible_distribution_version }} is supported for SAP HANA."
ignore_errors: "{{ not sap_hana_preconfigure_min_rhel_release_check }}"
Expand Down