Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
Updated to the lastet release
Browse files Browse the repository at this point in the history
  • Loading branch information
rhmk committed Sep 4, 2019
1 parent 273872a commit 32426d4
Show file tree
Hide file tree
Showing 46 changed files with 772 additions and 397 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.swp
*.retry

31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
sap-hana-preconfigure
=====================

This role configures a RHEL 7.x system according to the SAP notes so that SAP HANA is installable
This role configures a RHEL 7.x or RHEL 8 system according to the SAP notes so that SAP HANA is installable

Requirements
------------

To use this role your system needs to be installed with at least the RHEL core packges.
It is strongly recommended that you have run the following roles before this:
- 'linux-system-roles.timesync'
- 'linux-system-roles.sap-base-settings'
- 'linux-system-roles.sap-base-settings' (for RHEL 7.x)
- 'linux-system-roles.sap-preconfigure' (for RHEL 8.x)

It needs to be properly registered and have at least the following RedHat repositories accessable (see also example playbook):

for RHEL 7.x:
- RHEL Base Repository
- RHEL SAP HANA Repository

for RHEL 8.x:
- Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
- Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)
- Red Hat Enterprise Linux 8 for x86_64 - SAP Solutions (RPMs)


For details see the Red Hat knowledge base article: [How to subscribe SAP HANA systems to the Update Services for SAP Solutions](https://access.redhat.com/solutions/3075991))
You can use the [subscribe-rhn](https://galaxy.ansible.com/mk-ansible-roles/subscribe-rhn/) role to automate this process

Expand Down Expand Up @@ -99,13 +107,11 @@ The `installation.yaml` tasks install and update the system to with the current
sap_hana_preconfigure_reboot_after_update: false
```


Example Playbook
----------------

Here is an example playbook that prepares a server for hana installation.


```yaml
---
- hosts: hana
Expand Down Expand Up @@ -137,20 +143,29 @@ Here is an example playbook that prepares a server for hana installation.
- { role: linux-system-roles.sap-hana-preconfigure }
```

Here is a simple playbook:

```yaml
---
- hosts: all
roles:
- role: sap-preconfigure
- role: sap-hana-preconfigure
```

Contribution
------------

Please read the [developer guidelines](./README.DEV.md) if you want to contribute
Please read the [developer guidelines](./README.DEV.md) if you want to contribute

License
-------

Apache License
Version 2.0, January 2004
GNU General Public License v3.0

Author Information
------------------

Markus Koch, Thomas Bludau
Markus Koch, Thomas Bludau, Bernd Finger, Than Ngo

Please leave comments in the github repo issue list
54 changes: 28 additions & 26 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,8 @@ sap_hana_preconfigure_min_package_check: True
# if you set this to true, the installation part is run in check_mode only
sap_hana_preconfigure_installation_check_only: false

# default Kernel Parameters set in SAP Note 238241
# Additional possible tuning parameters. See SAP Note for details
# The following parameter do not work if communicates with hosts behind NAT firewall
# - { name: net.ipv4.tcp_tw_reuse, value: 1 }
# Tune these for low latency system replication
# net.ipv4.tcp_wmem and net.ipv4.tcp_rmem
sap_hana_preconfigure_kernel_parameters:
- { name: net.core.somaxconn, value: 4096 }
- { name: net.ipv4.tcp_max_syn_backlog, value: 8192}
- { name: net.ipv4.ip_local_port_range, value: "40000 61000" }
- { name: net.ipv4.tcp_timestamps, value: 1 }
- { name: net.ipv4.tcp_tw_recycle, value: 1 }
- { name: net.ipv4.tcp_slow_start_after_idle, value: 0 }
- { name: net.ipv4.tcp_syn_retries, value: 8 }
# Not sure about these .... they were in the old script and not set in tuned
- { name: kernel.shmmni, value: 65536 }
- { name: kernel.msgmni, value: 32768 }
- { name: kernel.sysrq, value: 1 }

# Set the following to false, if you do not want to update the system to the latest release
sap_hana_preconfigure_update: true
# Set the following to false if you do not want to update the system to the latest release
sap_hana_preconfigure_update: false

# I do not want to boot by default
# You can set this to true if you want to reboot after updating and before configuring the rest
Expand All @@ -60,10 +41,31 @@ sap_hana_preconfigure_reboot_timeout: 1800

###
#
# The following variables are optional
# If they are defined the user sapadm and sapsys will already be created
# this is necessary for installation of hostagent, but some customers require it at an earlier stage
# The following variables are optional.
# If they are defined, the users sapadm and sapsys will already be created
# This is necessary for installation of hostagent, but some customers require it at an earlier stage.
#
# sap_sapadm_uid:
# sap_sapadm_pw_clear
# sap_sapsys_gid
# sap_sapadm_pw_clear:
# sap_sapsys_gid:
# sap_hana_id_group_sapsys: not yet used
# sap_hana_id_user_sapadm: not yet used

## HANA kernel parameters
# [SAP Note 238241](https://launchpad.support.sap.com/#/notes/238241) defines kernel parameters that all Linux systems need to set.
# The parameters recomendation default is different dependant on the OS release. Hence the os dependant default setting is defined in
# ./vars/{{ansible_os_reelease}}.yml If you need to add or change parameters for your system copy these parameters from the vars file in
# to your system ivariable definitions and change them in the sap_hana_preconnfigure_kernel_parameters variable

sap_hana_preconfigure_kernel_parameters: "{{ sap_hana_preconfigure_kernel_parameters_default }}"

#### The following parameters are for PPC LE only
## add a list of interfaces where MTU size will be set to 9000
## defaults to empty
#sap_hana_preconfigure_ppcle_mtu9000_if: "{{ ansible_interfaces| difference(['lo']) }}" # all interfaces
sap_hana_preconfigure_ppcle_mtu9000_if: ''
## list where tso flag should be set
## defaults to all interfaces
sap_hana_preconfigure_ppcle_tso_if: "{{ ansible_interfaces| difference(['lo']) }}"

...
2 changes: 2 additions & 0 deletions example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@
- { role: mk-ansible-roles.preconfigure }
- { role: mk-ansible-roles.deployment }
- { role: mk-ansible-roles.hsr }

...
10 changes: 6 additions & 4 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
galaxy_info:
author: Markus Koch, Thomas Bludau
description: Configures a RHEL OS to be ready for SAP HANA installation
license: Apache 2.0
author: Markus Koch, Thomas Bludau, Bernd Finger <bfinger@redhat.com>, Than Ngo <than@redhat.com>
description: Configures a RHEL OS to be ready for SAP HANA installation
license: GNU General Public License v3.0
min_ansible_version: 2.5
platforms:
- name: EL
versions: [ 6, 7 ]
versions: [ 6, 7, 8 ]

galaxy_tags: [ 'system', 'sap', 'hana', 'beta' ]

dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

...
17 changes: 17 additions & 0 deletions tasks/RedHat/configuration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---

#- name: Enable Debugging
# debug:
# verbosity: "{{ debuglevel }}"
#
- name: list of required SAP Notes
debug:
var: sap_hana_preconfigure_sapnotes | difference([''])

- name: include configuration actions for required sapnotes
include_tasks: "sapnote/{{ item }}.yml"
with_items: "{{ sap_hana_preconfigure_sapnotes | difference(['']) }}"

- include: "{{ './' + ansible_distribution + '_' + ansible_distribution_major_version + '/recommendations.yml' }}"

...
6 changes: 4 additions & 2 deletions tasks/installation.yml → tasks/RedHat/installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@
# verbosity: "{{ debuglevel }}"
#
# Minimum supported Supported Kernel versions and patches to use with certified Hardware for SAP HANA on RHEL 7
# TODO: use jinja function version (version_compare) -> ansible user guide

- name: ensure minimal required packages are installed
package:
state: present
name: "{{ sap_hana_preconfigure_min_pkgs }}"
when:
- sap_hana_preconfigure_min_package_check
- sap_hana_preconfigure_min_package_check|bool
- not( (sap_hana_preconfigure_min_pkgs is undefined) or (sap_hana_preconfigure_min_pkgs is none) or (sap_hana_preconfigure_min_pkgs | trim == '') )

- name: ensure required packagegroups are installed
package:
state: present
name: "{{ sap_hana_preconfigure_packagegroups }}"
update_only: true
check_mode: "{{ sap_hana_preconfigure_installation_check_only }}"

# temporary
Expand All @@ -41,7 +43,7 @@
package:
state: latest
name: "*"
when: sap_hana_preconfigure_update
when: sap_hana_preconfigure_update|bool
check_mode: "{{ sap_hana_preconfigure_installation_check_only }}"
register: sap_hana_preconfigure_register_packageinstall

Expand Down
52 changes: 0 additions & 52 deletions tasks/RedHat7/recommendations.yml

This file was deleted.

File renamed without changes.
41 changes: 41 additions & 0 deletions tasks/RedHat_7/recommendations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---

## This creates the SAP Users in case you define them in your playbook
## This has been done for providers who want to create the SAP users before handing
## over the image to clients
- name: ensure sapadm group and sapadm user is created
block:
- name: ensure sapdm user exists
group:
name: sapsys
gid: "{{ sap_sapsys_gid }}"
- name: ensure sapadm user exists
user:
name: sapadm
uid: "{{ sap_sapadm_uid }}"
group: sapsys
password: "{{ sap_sapadm_pw_clear|password_hash('sha512') }}"
when:
- sap_sapsys_gid is defined
- sap_sapadm_uid is defined
- sap_sapadm_pw_clear is defined

### Disable tempfile handling, otherwise things are gone after reboot
- name: disable temp file handling for SAP applications
copy: src=etc/tmpfiles.d/sap.conf dest=/etc/tmpfiles.d/sap.conf

- name: increase file handles to at least 32800 for sapsys group
pam_limits:
dest: /etc/security/limits.d/99-sapsys.conf
domain: "@sapsys"
limit_item: nofile
limit_type: "{{ line_item }}"
value: 32800
use_max: yes
with_items:
- soft
- hard
loop_control:
loop_var: line_item

...
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
## Most of this is described in SAP Note 2009879

## TODO: Next task should be moved to sap-deploy, or sap-hostagent install !
- name: ensure sapadm group and sapadm user is created
- name: ensure sapsys group and sapadm user are created
block:
- name: ensure sapsys user exists
- name: ensure sapsys group exists
group:
name: sapsys
gid: "{{ sap_sapsys_gid }}"
Expand Down
2 changes: 1 addition & 1 deletion tasks/configuration.yml → tasks/SLES/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
var: sap_hana_preconfigure_sapnotes | difference([''])

- name: include configuration actions for required sapnotes
include_tasks: "sapnotes/{{ item }}.yml"
include_tasks: "sapnotes/{{ item }}/configuration.yml"
with_items: "{{ sap_hana_preconfigure_sapnotes | difference(['']) }}"

- include: "{{ './' + ansible_distribution + ansible_distribution_major_version + '/recommendations.yml' }}"
Expand Down
15 changes: 15 additions & 0 deletions tasks/SLES/installation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---

#- name: Enable Debugging
# debug:
# verbosity: "{{ debuglevel }}"
#
- name: list of required SAP Notes
debug:
var: sap_hana_preconfigure_sapnotes | difference([''])

- name: include configuration actions for required sapnotes
include_tasks: "tasks/sapnote/{{ item }}/installation.yml"
with_items: "{{ sap_hana_preconfigure_sapnotes | difference(['']) }}"

...
23 changes: 23 additions & 0 deletions tasks/SLES15/recommendations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---


## TODO: Next task should be moved to sap-deploy, or sap-hostagent install !
- name: ensure sapadm group and sapadm user is created
block:
- name: ensure sapadm user exists
group:
name: sapsys
gid: "{{ sap_sapsys_gid }}"
- name: ensure sapadm user exists
user:
name: sapadm
uid: "{{ sap_sapadm_uid }}"
group: sapsys
password: "{{ sap_sapadm_pw_clear|password_hash('sha512') }}"
when:
- sap_sapsys_gid is defined
- sap_sapadm_uid is defined
- sap_sapadm_pw_clear is defined


...
Loading

0 comments on commit 32426d4

Please sign in to comment.