Giter VIP home page Giter VIP logo

sap-hana-preconfigure's Issues

2455582.yml can be removed.

The topic of this SAP note (GCC 6.x) is already covered completely by vars/RedHat_7.yml. And RHEL 8 comes with GCC 6 compatibility.

Role is not recognizing cloud eus/e4s repositories

- name: Check for EUS or E4S repository
shell: |
yum repolist | awk '
BEGIN {a=0}
/rhel-{{ ansible_distribution_major_version }}-server-e[4u]s-rpms/ {a++}
/rhel-sap-hana-for-rhel-{{ ansible_distribution_major_version }}-server-e[4u]s-rpms/ {a++}
END {print a}'
register: sap_hana_preconfigure_register_eus
changed_when: false

repos are named like this:
rhui-rhel-7-server-rhui-eus-rpms
rhel-sap-for-rhel-7-server-eus-rhui-rpms
rhui-sap-hana-for-rhel-7-server-eus-rpms

role fails, if firewalld is not installed

When using this role on a system without firewalld installed, the systemctl module throws an error.
So either we add firewalld to the list of required packages or check that it is not installed

Add support for --check (-c) option

Make sure that the role works in playbooks that run with the --check (-c) option. This option set the variable check_only to true, so that modules will not execute their tasks, but only print what they would do.
Hence some shell snippets and other tasks that set prerequisites and variables need to run in check mode too.

RHEL 8 PPCLE Packages

The follwoing packages are required for ppcle on Power 9

yum install librtas src rsct.core.utils rsct.core rsct.basic rsct.opt.storagerm
devices.chrp.base.ServiceRM DynamicRM ncurses-libs readline sqlite
sg3_utils libgcc libstdc++ zlib iprutils lsvpd libvpd libservicelog
servicelog powerpc-utils ppc64-diag IBMinvscout

They are currently disabled in the role, as they were not available during test. They are now available via:
https://public.dhe.ibm.com/software/server/POWER/Linux/yum/OSS/RHEL/8/ppc64le/

valid for RHEL8.0 and 8.1

Problem while "include os specific vars"

A variable will be defined three times. This looks like, if this is not the perfect way. I did not tested it with RHEL 7.3 an 7.2.

TASK [sap-hana-preconfigure : include os specific vars]


[WARNING]: While constructing a mapping from /tmp/dev/ansible/sap-hana-preconfigure/vars/RedHat_7.yml, line 5,
column 1, found a duplicate dict key (sap_hana_preconfigure_min_packages). Using last defined value only.
[WARNING]: While constructing a mapping from /tmp/dev/ansible/sap-hana-preconfigure/vars/RedHat_7.yml, line 5,
column 1, found a duplicate dict key (when). Using last defined value only.
ok: [40.114.142.135] => (item=/tmp/dev/ansible/sap-hana-preconfigure/vars/RedHat_7.yml)

required for update and reboot

The test for updating is failing. rc is not defined:
See output:
TASK [sap-hana-preconfigure : restart machine if required] *********************

fatal: [dhcp168.coe.muc.redhat.com]: FAILED! => {"msg": "The conditional check 'sap_hana_preconfigure_reboot_after_update == true and sap_hana_preconfigure_register_reboot_required.rc == 1' failed. The error was: error while evaluating conditional (sap_hana_preconfigure_reboot_after_update == true and sap_hana_preconfigure_register_reboot_required.rc == 1): 'dict object' has no attribute 'rc'\n\nThe error appears to be in '/usr/share/ansible/roles/sap-hana-preconfigure/tasks/RedHat/installation.yml': line 85, column 9, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n # inspired by https://support.ansible.com/hc/en-us/articles/201958037-Reboot-a-server-and-wait-for-it-to-come-back\n - name: restart machine if required\n ^ here\n"}

...ignoring

TASK [sap-hana-preconfigure : waiting for server to come back] *****************

fatal: [dhcp168.coe.muc.redhat.com]: FAILED! => {"msg": "The conditional check 'sap_hana_preconfigure_reboot_after_update == true and sap_hana_preconfigure_register_reboot_required.rc == 1' failed. The error was: error while evaluating conditional (sap_hana_preconfigure_reboot_after_update == true and sap_hana_preconfigure_register_reboot_required.rc == 1): 'dict object' has no attribute 'rc'\n\nThe error appears to be in '/usr/share/ansible/roles/sap-hana-preconfigure/tasks/RedHat/installation.yml': line 92, column 9, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: waiting for server to come back\n ^ here\n"}

PLAY RECAP *********************************************************************
dhcp168.coe.muc.redhat.com : ok=11 changed=1 unreachable=0 failed=1 skipped=2 rescued=0 ignored=1
422 Client Error: Unprocessable Entity

Use ansible reboot module

As soon as you don't support ansible 2.6 anymore you can move to reboot module

- name: Reboot if required
block:
# Reboot the server now and wait until it is back
# inspired by https://support.ansible.com/hc/en-us/articles/201958037-Reboot-a-server-and-wait-for-it-to-come-back
- name: restart machine if required
shell: sleep 2 && shutdown -r now "Ansible updates triggered"
async: 1
poll: 0
become: true
ignore_errors: true
- name: waiting for server to come back
local_action: wait_for host={{ inventory_hostname }} port=22 state=started delay=90 sleep=2 timeout={{ sap_hana_preconfigure_reboot_timeout }}
become: false
when: sap_hana_preconfigure_reboot_after_update == true and sap_hana_preconfigure_register_reboot_required.rc == 1

would become:

- name: Reboot if required
  reboot:
    reboot_timeout: "{{ sap_hana_preconfigure_reboot_timeout }}"
  when: sap_hana_preconfigure_reboot_after_update == true and sap_hana_preconfigure_register_reboot_required.rc == 1

check if reboot is required (7.3+)

Integration of check if reboot is required (7.2) and check if reboot is required (7.3+) are not compatible with each other.

Here are two variables registred with one name. This will not work, because i got everytime the output (variable reboot_required) of the last task, and for a rhel 7.4 system this is a empty variable.
(Changed the register variable to reboot_required_72 before, but this is only much more complex.)

Also i commented the broken passage. Not tested with a rhel 7.2

reboot fails on RHEL 8

the command needs-rebooting is not executed on RHEL 8, hence if you set the variable sap_hana_preconfigure_reboot_after_update == true
the playbook fails.
Required fix:

  • add yum-utils to the list of required packages (not installed by default)
  • change the when statement to ansible_distribution_major_version >=7 in task "check if reboot is required (7.3+)"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.