Chapter 2. Installing the Ansible Engine and RHEL System Roles for SAP
Use the following procedure for installing Ansible Core and the RHEL System Roles for SAP package or collection.
For installing packages on a Red Hat Satellite system, do not use the plain dnf command but follow the instructions in How to install or update packages in Red Hat Satellite 6?.
Procedure
Install Ansible Core:
dnf install ansible-core
# dnf install ansible-coreCopy to Clipboard Copied! Toggle word wrap Toggle overflow Continue with step 2 for installing the RHEL package
rhel-system-roles-sapor with step 3 for installing the Automation Hub collectionredhat.sap_install.For installing the RHEL package
rhel-system-roles-sap:Enable the RHEL for SAP Solutions repository using Red Hat Subscription Manager:
subscription-manager repos
# subscription-manager repos --enable=rhel-$(rpm -E %rhel)-for-$(uname -m)-sap-solutions-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the RHEL System Roles for SAP:
dnf install rhel-system-roles-sap
# dnf install rhel-system-roles-sapCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
rhel-system-roles-sappackage is installed to/usr/share/ansible/roles/<role>, where<role>is the name of the individual role, for example,sap_hana_preconfigure. Each role includes aREADME.mdfile which explains all variables and how to use the role.
For installing the Automation Hub collection
redhat.sap_install, you can either directly install the collection from Automation Hub or first download it and then install it from the downloaded file.To install the collection directly from Automation Hub, follow the instructions on this page. The essential steps are:
- Make a copy of your Offline token, the Server URL, and the SSO URL from this page and note the Server URL and SSO URL on the same page. If needed (e.g. because it expired), recreate the token.
Use these values to configure file
/etc/ansible/ansible.cfgaccording to the instructions in this chapter. Use the Server URL for variableurl, the SSO URL for variableauth_url, and the Offline token for variabletoken, as in the following example (replace the dummy token by the actual token):Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the collection by running the following command as the user which will use the collection (the user which will run the playbooks to install software or configure settings on managed nodes):
ansible-galaxy collection install redhat.sap_install
# ansible-galaxy collection install redhat.sap_installCopy to Clipboard Copied! Toggle word wrap Toggle overflow This will install the collection into the default location for the user (necessary directories will be created recursively), which is:
~/.ansible/collections/ansible_collections/redhat/sap_install.
To download the collection from Automation Hub and then install it, perform the following step:
Download the collection tar file from this page (use the
Download tarballlink) and then run the following command as the user which will use the collection:ansible-galaxy collection install
# ansible-galaxy collection install ./redhat-sap_install-1.2.1.tar.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow This will also install the collection into the default location for the user, as described before.
The fileREADME.mdin each role’s subdirectory belowsap_install, e.g.roles/sap_general_preconfigure, contains the documentation for each of the roles.