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

rewrite trento community checks regarding 'package version' #124

Merged
merged 6 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
28 changes: 28 additions & 0 deletions priv/catalog/222A57.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
id: "222A57"
name: "sbd version"
arbulu89 marked this conversation as resolved.
Show resolved Hide resolved
group: "OS and package versions"
description: |
SBD version is supported
remediation: |
## Abstract
Installed SBD version must be equal or higher than the recommended value

## Remediation
Install or upgrade to a supported SBD version

## Reference
- https://documentation.suse.com/en-us/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/

facts:
- name: package_sbd
gatherer: package_version
argument: sbd

values:
- name: expected_sbd_version
#should only run on 'azure', 'nutanix' or 'kvm', NOT on 'gcp' or 'aws'
default: "1.4.0"

expectations:
- name: expectations_sbd_version
expect: facts.package_sbd >= values.expected_sbd_version
27 changes: 27 additions & 0 deletions priv/catalog/9FAAD0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
id: "9FAAD0"
name: "pacemaker version"
group: "OS and package versions"
description: |
Pacemaker version is not the recommended value
remediation: |
## Abstract
Installed Pacemaker version must not be equal than the recommended value

## Remediation
Install or upgrade to a supported Pacemaker version

## Reference
- https://documentation.suse.com/en-us/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/

facts:
- name: exclude_package_pacemaker
gatherer: package_version
argument: pacemaker

values:
- name: expected_pacemaker_version_to_exclude
default: "2.0.3+20200511.2b248d828"

expectations:
- name: expectations_pacemaker_version_to_exclude
expect: facts.exclude_package_pacemaker != values.expected_pacemaker_version_to_exclude
27 changes: 27 additions & 0 deletions priv/catalog/9FEFB0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
id: "9FEFB0"
name: "pacemaker version"
group: "OS and package versions"
description: |
Pacemaker version is supported
remediation: |
## Abstract
Installed Pacemaker version must be equal or higher than the recommended value

## Remediation
Install or upgrade to a supported Pacemaker version

## Reference
- https://documentation.suse.com/en-us/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/

facts:
- name: package_pacemaker
gatherer: package_version
argument: pacemaker

values:
- name: expected_pacemaker_version
default: "2.0.1"

expectations:
- name: expectations_pacemaker_version
expect: facts.package_pacemaker >= values.expected_pacemaker_version
28 changes: 28 additions & 0 deletions priv/catalog/C3166E.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
id: "C3166E"
name: "sbd version"
group: "OS and package versions"
description: |
SBD version is not the recommended value
remediation: |
## Abstract
Installed SBD version must not be equal than the recommended value

## Remediation
Install or upgrade to a supported SBD version

## Reference
- https://documentation.suse.com/en-us/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/

facts:
- name: exclude_package_sbd
gatherer: package_version
argument: sbd

values:
- name: expected_sbd_version_to_exclude
#should only run on 'azure', 'nutanix' or 'kvm', NOT on 'gcp' or 'aws'
default: "1.4.0+20190326.c38c5e6"

expectations:
- name: expectations_sbd_version_to_exclude
expect: facts.exclude_package_sbd != values.expected_sbd_version_to_exclude
41 changes: 41 additions & 0 deletions priv/catalog/CAEFF1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
id: "CAEFF1"
name: "OS flavor SLES_SAP"
group: "OS and package versions"
description: |
Operating system vendor is supported
remediation: |
## Abstract
SAPHanaSR is only supported on SUSE Linux Enterprise Server for SAP Applications.

## Remediation
Please use SUSE Linux Enterprise Server for SAP Applications.

## Reference
Azure:

- https://docs.microsoft.com/en-us/azure/virtual-machines/workloads/sap/sap-hana-high-availability

AWS:

- https://docs.aws.amazon.com/sap/latest/sap-hana/sap-hana-on-aws-ha-cluster-configuration-on-sles.html

GCP:

- https://cloud.google.com/solutions/sap/docs/sap-hana-os-support

Nutanix:

- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-planning-the-installation

SUSE / KVM:

- https://documentation.suse.com/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/#id-planning-the-installation

facts:
- name: os_flavor
gatherer: package_version
argument: SLES_SAP-release
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This usage of the package_version gatherer would result in the following command

$ rpm -q --qf "%{VERSION}" SLES_SAP-release

Is this the way to determine that the OS is SLES4SAP? Asking because I might very well ignore it 😅
I tried it on a SLES 15 sp3 of ours - not a 4SAP though - and it returns package SLES_SAP-release is not installed

If the package_version gatherer is not suitable to determine the OS, we might need a different gatherer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, your right. It is a workaround, but a reliable working 'workaround'. The package 'SLES_SAP-release' is only available on SLES for SAP systems. On a plain SLES you will have the 'SLES-release' package.
The recommended way (as we told our partners) is to evaluate /etc/products.d/baseproduct and search for '<name>', '<cpeid>' or '<productline>' depending on the use case.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@angelabriel We can merge as it is by now, and open a new ticket to maybe implement a new gatherer to get the version. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arbulu89 Sounds good. Having a gatherer for the os version (based on /etc/os-release or /etc/products.d/baseproduct ) and the os flavor (based on /etc/products.d/baseproduct ) would be really nice.
But it's not urgent as by now we can live with the workarounds.
Thanks


expectations:
- name: expectations_SLES_SAP
expect: facts.os_flavor != ""
27 changes: 27 additions & 0 deletions priv/catalog/D028B9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
id: "D028B9"
name: "OS version SLES_SAP"
group: "OS and package versions"
description: |
Operating system version is supported
remediation: |
## Abstract
You need at least SUSE Linux Enterprise Server for SAP Applications 15 SP1 or newer

## Remediation
Please install or upgrade to a supported OS version

## Reference
- https://documentation.suse.com/en-us/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/

facts:
- name: SLES_SAP_version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would stick to small case here for the name

gatherer: package_version
argument: SLES_SAP-release
nelsonkopliku marked this conversation as resolved.
Show resolved Hide resolved

values:
- name: expected_SLES_SAP_version
default: "15.1"

expectations:
- name: expectations_SLES_SAP_version
expect: facts.SLES_SAP_version >= values.expected_SLES_SAP_version
27 changes: 27 additions & 0 deletions priv/catalog/DC5429.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
id: "DC5429"
name: "corosync version"
group: "OS and package versions"
description: |
Corosync version is supported
remediation: |
## Abstract
Installed Corosync version must be equal or higher than the recommended value

## Remediation
Install or upgrade to a supported Corosync version

## Reference
- https://documentation.suse.com/en-us/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/

facts:
- name: package_corosync
gatherer: package_version
argument: corosync

values:
- name: expected_corosync_version
default: "2.4.5"

expectations:
- name: expectations_corosync_version
expect: facts.package_corosync >= values.expected_corosync_version
27 changes: 27 additions & 0 deletions priv/catalog/F50AF5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
id: "F50AF5"
name: "python3 version"
group: "OS and package versions"
description: |
Python3 version is supported
remediation: |
## Abstract
Installed Python3 version must be equal or higher than the recommended value

## Remediation
Install or upgrade to a supported Python3 version

## Reference
- https://documentation.suse.com/en-us/sbp/all/single-html/SLES4SAP-hana-sr-guide-PerfOpt-15/

facts:
- name: package_python3
gatherer: package_version
argument: python3

values:
- name: expected_python3_version
default: "3.6.5"

expectations:
- name: expectations_python3_version
expect: facts.package_python3 >= values.expected_python3_version