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 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
25 changes: 25 additions & 0 deletions priv/catalog/222A57.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
id: "222A57"
name: supported sbd version
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/

when: env.provider in ["azure", "nutanix", "kvm"]

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

expectations:
- name: expectations_sbd_version
expect: facts.package_sbd < 1
23 changes: 23 additions & 0 deletions priv/catalog/9FAAD0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
id: "9FAAD0"
name: unsupported 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,2.0.3+20200511.2b248d828
Copy link
Contributor

Choose a reason for hiding this comment

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

This could very well done as before, just letting the version in the values, and comparing with the package version string, as we simply wanted a different value.
But both work


expectations:
- name: expectations_pacemaker_version_to_exclude
expect: facts.exclude_package_pacemaker != 0
23 changes: 23 additions & 0 deletions priv/catalog/9FEFB0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
id: "9FEFB0"
name: supported 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,2.0.1

expectations:
- name: expectations_pacemaker_version
expect: facts.package_pacemaker < 1
25 changes: 25 additions & 0 deletions priv/catalog/C3166E.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
id: "C3166E"
name: unsupported 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/

when: env.provider in ["azure", "nutanix", "kvm"]

facts:
- name: exclude_package_sbd
gatherer: package_version
argument: sbd,1.4.0+20190326.c38c5e6

expectations:
- name: expectations_sbd_version_to_exclude
expect: facts.exclude_package_sbd != 0
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 != ()
23 changes: 23 additions & 0 deletions priv/catalog/D028B9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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
gatherer: package_version
argument: SLES_SAP-release,15.1

expectations:
- name: expectations_sles_sap_version
expect: facts.sles_sap_version < 1
23 changes: 23 additions & 0 deletions priv/catalog/DC5429.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
id: "DC5429"
name: supported 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,2.4.5

expectations:
- name: expectations_corosync_version
expect: facts.package_corosync < 1
23 changes: 23 additions & 0 deletions priv/catalog/F50AF5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
id: "F50AF5"
name: supported 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,3.6.5

expectations:
- name: expectations_python3_version
expect: facts.package_python3 < 1