HCL-TECH-SOFTWARE / connections-automation

Deployment and upgrade automation scripts for HCL Connections 7.0 based on Ansible
Apache License 2.0
17 stars 31 forks source link

Installation of DB2 fails, but playbook runs until the end #183

Closed stoeps13 closed 2 years ago

stoeps13 commented 2 years ago

Hi, I test the installation with https://repo.almalinux.org/almalinux/8/cloud/x86_64/images/ the cloud images for Almalinux (binary compatible to RHEL). It is comparable to a minimal installation.

I run the playbooks/setup-connections-complete.yml and one of the first tasks is the DB2 installation, which fails:

TASK [db2-install : Install DB2] *********************************************************************************
fatal: [cnx7-rh8-db2.stoeps.home]: FAILED! => changed=true 
  cmd:
  - /opt/IBM/InstallBinaries/universal/db2setup
  - -r
  - /opt/IBM/InstallBinaries/universal/db2server.rsp
  delta: '0:00:00.081528'
  end: '2022-01-26 08:59:04.671372'
  msg: non-zero return code
  rc: 67
  start: '2022-01-26 08:59:04.589844'
  stderr: |-
    ERROR:
       The 'strings' utility that is used to detect prerequisite libraries
       is not present on this system.  Please use your package or software
       manager to install the GNU Binary Utilities.
    Requirement not matched for DB2 database "Server" . Version: "11.5.6.0".

    Summary of prerequisites that are not met on the current system:

       DBT3514W  The db2prereqcheck utility failed to find the following 32-bit library file: "/lib/libpam.so*".

    DBT3520E  The db2prereqcheck utility could not find the library file libaio.so.1.
  stderr_lines: <omitted>
  stdout: |2-
      Aborting the current installation ...
      Run installation with the option "-f sysreq" parameter to force the installation.
  stdout_lines: <omitted>

TASK [db2-install : Apply the license to DB2] ********************************************************************
skipping: [cnx7-rh8-was.stoeps.home]
skipping: [cnx7-rh8.stoeps.home]

So the strings package (and some more) is missing, DB2 can't be installed, but the whole installation runs until the end. The Db2 database creation fails because of this, for example, but the playbook does not stop. So 1. there should be a package installation for all prerequisites of DB2 and if the installation fails, 2. the playbook needs to stop.

Regards Christoph

stoeps13 commented 2 years ago

I found the problem:

diff --git a/roles/third_party/ibm/db2-install/tasks/setup_os.yml b/roles/third_party/ibm/db2-install/tasks/setup_os.yml
index 5660ba3..47ba84c 100644
--- a/roles/third_party/ibm/db2-install/tasks/setup_os.yml
+++ b/roles/third_party/ibm/db2-install/tasks/setup_os.yml
@@ -59,7 +59,6 @@
     state:           present
   when:
     - ansible_os_family == "RedHat"
-    - (ansible_distribution == "RedHat"or ansible_distribution == "CentOS"or ansible_distribution == "Amazon")

 - name:              Install pre-requisites Yum
   yum:
@@ -67,14 +66,13 @@
     state:           present
   when:
     - ansible_os_family == "RedHat"
-    - (ansible_distribution == "RedHat"or ansible_distribution == "CentOS"or ansible_distribution == "Amazon")

 - name:              Install pre-requisites Yum for RHEL 8
   yum:
     name:            ['patch', 'make', 'gcc-c++']
     state:           present
   when:
-    - ansible_distribution == "RedHat"
+    - ansible_os_family == "RedHat"
     - ansible_distribution_major_version == "8"

 - name:              Disable SELinux

So there is a conditional which is only working for CentOS, RHEL and Amazon. Additionally, the pre-req script only selects RedHat distribution, but not CentOS or other RedHat Linux family members.

As Amazon is not on the supported List for Connections 7 and Almalinux or Rockylinux are binary compatible and perfect for testing deployments without using a RHEL license, I would add the diff mentioned above and it should work with all RHEL 8 compatibel Linux OS.

But still when the installation of DB2 fails, it should stop the playbook.

nitinjagjivan commented 2 years ago

@stoeps13 Thank you for for the suggestion and for raising this issue. We will test it on multiple distributions and create a PR accordingly. Regarding 'Installation of DB2 fails, but playbook runs until the end' I will add any_errors_fatal and test it.

sabrina-yee commented 2 years ago

Addressed in Feb 2022 release.