diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7615c5f..98bd61b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,20 @@ SAP Operations Collection Release Notes .. contents:: Topics +v1.1.0 +====== + +Release Summary +--------------- + +Feature Release + +New Modules +----------- + +- sap.sap_operations.hana_backup - Create SAP HANA database file backup +- sap.sap_operations.host_info - Collect information about installed SAP instances on the host + v1.0.5 ====== diff --git a/FILES.json b/FILES.json index d742908..5467e76 100644 --- a/FILES.json +++ b/FILES.json @@ -49,6 +49,13 @@ "chksum_sha256": null, "format": 1 }, + { + "name": "plugins/doc_fragments/saphost.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2b7347e9931aa033d61647a995bb3e926f8d48e792a2640e69729c73095e304f", + "format": 1 + }, { "name": "plugins/module_utils", "ftype": "dir", @@ -56,18 +63,25 @@ "chksum_sha256": null, "format": 1 }, + { + "name": "plugins/module_utils/saphost.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "07025d1cba4dfbdbadd9c2ff6634b398c625774860e2ec2933f1badf3f06bd6f", + "format": 1 + }, { "name": "plugins/module_utils/valid_sid.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e6ee7270cbffc824123cd76ab76f52ff33cc14a08c4c75d5c66e3bb07723b3ec", + "chksum_sha256": "bdb8f346a7215b7fc4c960d054e994d50f5e601f8f4ecc9d7a4c4a4b25f9036f", "format": 1 }, { "name": "plugins/module_utils/soap.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9836d64990df6a99bf6e648901d7b74e7f6bdcbce97ca9285945945ea23ccd31", + "chksum_sha256": "91368dc14e2336f4d537355fdae8cef71e203098566d342566ef3ff7fc99d61a", "format": 1 }, { @@ -109,7 +123,7 @@ "name": "plugins/modules/hana_backup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "bd78640b5be0cadebdba250331cf3149167011cf80faa75fcabbe2318ea135b3", + "chksum_sha256": "050346c44f751e899ff2cccf42942dff5d124561292dfac912a99e85a1526038", "format": 1 }, { @@ -130,14 +144,21 @@ "name": "plugins/modules/hdbuserstore.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "46e1601ceda147dfd5394a72c71c6bf1df5df596cb04c60d4f2aca9f0818220d", + "chksum_sha256": "272c81a1ed89c8e957d32ec8183608c2f8593af947868512b504dca12f29a464", "format": 1 }, { "name": "plugins/modules/hdbuserstore_info.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "1c998d026e6cb99840baeb93eeaca7037605e65bbf30a8d2e0cbdc51ca8e0ca5", + "chksum_sha256": "4bca7c4124f3abd08c7276028dbb0178856accb8508fb123b225cebac109cdb9", + "format": 1 + }, + { + "name": "plugins/modules/host_info.py", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4533b76c205c5543dc932dd6d9d34147874e94b1e14c61a23c2bc0e0e5c511df", "format": 1 }, { @@ -148,12 +169,229 @@ "format": 1 }, { - "name": "include", + "name": ".ruff_cache", "ftype": "dir", "chksum_type": null, "chksum_sha256": null, "format": 1 }, + { + "name": ".ruff_cache/content", + "ftype": "dir", + "chksum_type": null, + "chksum_sha256": null, + "format": 1 + }, + { + "name": ".ruff_cache/content/405b91fdf272c003", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "afe0deb1adc1176fe45b744881dff159a492bc0f3465f9ed1492e67977ab2479", + "format": 1 + }, + { + "name": ".ruff_cache/content/5c82e25e73a09ffe", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "4179854937ab2167995c214f57f6c773fae2e7c499d98817059808090d49f51d", + "format": 1 + }, + { + "name": ".ruff_cache/content/c281055682c176fe", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9d908ecfb6b256def8b49a7c504e6c889c4b0e41fe6ce3e01863dd7b61a20aa0", + "format": 1 + }, + { + "name": ".ruff_cache/content/a8b25d1e11a904ee", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "e052fe65a2e6a65d340727c3b94adddb63f1054ff3f39142a4a2a80aeb4b0ef3", + "format": 1 + }, + { + "name": ".ruff_cache/content/1627948fdbb1f40f", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "46a894c435a58961a61f0c43baec3447c9c79d0ac829efd47e5b7728a77ec216", + "format": 1 + }, + { + "name": ".ruff_cache/content/4b1df0c087e09d61", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9a1fe0a829836a29a6779be794d58807ceb54f089b412eac7419902b8a33a973", + "format": 1 + }, + { + "name": ".ruff_cache/content/dc306c5a3b97a24a", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9d908ecfb6b256def8b49a7c504e6c889c4b0e41fe6ce3e01863dd7b61a20aa0", + "format": 1 + }, + { + "name": ".ruff_cache/content/5383204445361ce3", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9d908ecfb6b256def8b49a7c504e6c889c4b0e41fe6ce3e01863dd7b61a20aa0", + "format": 1 + }, + { + "name": ".ruff_cache/content/91d019a83c1005ac", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "06bc122910e906a073f7cbd6504b69d8d99377e2e1312263595da3884b1dfd3e", + "format": 1 + }, + { + "name": ".ruff_cache/content/6233b29207d9f4d", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9d908ecfb6b256def8b49a7c504e6c889c4b0e41fe6ce3e01863dd7b61a20aa0", + "format": 1 + }, + { + "name": ".ruff_cache/content/7c2decd10b03de98", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5e9c67aeba2deeb6038dcccb693cd5a771b9b6ca49bc4ec5cf39a1283d9577f5", + "format": 1 + }, + { + "name": ".ruff_cache/content/6b4afa56e204248c", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "780b2e1d4b0a54758d682659e5217d2a09b166dfe0ed643fb1fd129097ef696c", + "format": 1 + }, + { + "name": ".ruff_cache/content/49afeb385f405067", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "2a939b324c966fca687926f40d96e6b12c1ebbf78a6e181fbe0e490ee3d32fce", + "format": 1 + }, + { + "name": ".ruff_cache/content/8394bce7fe0c3585", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c24ad00382cdb67cc0128502aee6b353a6380221e1ec34019d46fbf5bd803d8c", + "format": 1 + }, + { + "name": ".ruff_cache/content/ba2e1b52672339ba", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9d908ecfb6b256def8b49a7c504e6c889c4b0e41fe6ce3e01863dd7b61a20aa0", + "format": 1 + }, + { + "name": ".ruff_cache/content/2413da0c68e35f3d", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "40fd5fd50dabcfd087d735e25b0b2031d68afb69e9a6278cbb8a002d2dce009f", + "format": 1 + }, + { + "name": ".ruff_cache/content/893c89f60a3185fd", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "63f77c7faf70e6d2c2f2346d41b22a33a5148134cba7b45b8b67830a3ce092b2", + "format": 1 + }, + { + "name": ".ruff_cache/content/8a0059ff6e28ab13", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6d0518149d22d63fafd56db915a36256cb1af0f6814b0421ed11f2b628e012dc", + "format": 1 + }, + { + "name": ".ruff_cache/content/6f71c92072b9407", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "03dd2fb5ec487b12d7304ae46fb1c1bf9f9e2e90bd889eaaa9119968d805831a", + "format": 1 + }, + { + "name": ".ruff_cache/content/e49005b4a879b445", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "16f1c4c9c0312e7d07a197cda91d41eb9cea1769eca7acfdde2351272b759bca", + "format": 1 + }, + { + "name": ".ruff_cache/content/65422f76766a5d5f", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "9d908ecfb6b256def8b49a7c504e6c889c4b0e41fe6ce3e01863dd7b61a20aa0", + "format": 1 + }, + { + "name": ".ruff_cache/content/5e6de536477949c9", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "43a1447c21885e1a2356856e3a63dd162ee66a001f2bd52005997b05b0ed2ac2", + "format": 1 + }, + { + "name": ".ruff_cache/content/2e317550f6696385", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "c21b7320005fcf0e8e25815870e5fed23899a4e41a52a047a457910525e04f32", + "format": 1 + }, + { + "name": ".ruff_cache/content/fe59baa1ba5a6411", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "cdc46b2b034d829260f7fe346b1c6b78ab71a8f2e037302db42f71daed75a176", + "format": 1 + }, + { + "name": ".ruff_cache/content/5f63f6f7f0fb73bd", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "09ecd748031898bb4b39ea3eaeb3c33dbb14f11b8b87f0300ca95f2f1fa33717", + "format": 1 + }, + { + "name": ".ruff_cache/content/c4bf9614010433d3", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "eddade07361ee21c4867ef104f94f5e129cbf462cb8a36c1d111c64d160d69ab", + "format": 1 + }, + { + "name": ".ruff_cache/content/bc25e680915b5f2b", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ae0315cb4d0f5e4c867179588e72a981c371ea302222060dd5434cfa7d3b0ac7", + "format": 1 + }, + { + "name": ".ruff_cache/content/d6cd7660728ced6d", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "94347e4fe7befbfebec44f67c31e4ccc04668c333fe08f640c2c999df0a9656a", + "format": 1 + }, + { + "name": ".ruff_cache/CACHEDIR.TAG", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "5953156d7e0c564a427251316eaf26f8870e6483ae2197f916b630e4f93e31ae", + "format": 1 + }, + { + "name": ".ruff_cache/.gitignore", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "684888c0ebb17f374298b65ee2807526c066094c701bcc7ebbe1c1095f494fc1", + "format": 1 + }, { "name": "meta", "ftype": "dir", @@ -298,28 +536,28 @@ "name": "roles/sap_kernel_update/tasks/normal_kernel_upgrade.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5a625800747676465098896932880b95209a8f7a7711eda797d7b5ebd6cd6d92", + "chksum_sha256": "c8679a149d7655072996ee1c353e36e96ba2a6ce7d1cf4e2d51dfb01f3f0748e", "format": 1 }, { "name": "roles/sap_kernel_update/tasks/rolling_kernel_upgrade.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f4e63e308170a40e43bf4f7c9e866860e8c359381d5f8d5ab19998fb49826e2f", + "chksum_sha256": "e7d30cc8866570950f97b817b6ffeef34a8d943207d3c8ab1ee42d494f93a5c4", "format": 1 }, { "name": "roles/sap_kernel_update/tasks/init.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e4c98deb7be67ee48936bd9ed982d73fe0a9baac46216bfd6222fe824d1a1445", + "chksum_sha256": "ff29ba5ad30a4406677b62abf71bd23e6e5fda748cad771cd3cd6a15a72e5beb", "format": 1 }, { "name": "roles/sap_kernel_update/tasks/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8f37cf2bbdaace6614bd61bfd5bd87957fb6a43a384719c17d406bd9d57a3f79", + "chksum_sha256": "89add5cc5f91de5e6706005be0c3fbcec28668c3a5122ade5c127b94bb1c75da", "format": 1 }, { @@ -333,7 +571,7 @@ "name": "roles/sap_kernel_update/meta/argument_specs.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3273084509744802a9080b6082904bf2bd28d5637b563dd45970236110c531ee", + "chksum_sha256": "b6afafce9d74876b23277e8205375e3d5b73746cb7d50455219bc15a7f0a6533", "format": 1 }, { @@ -389,7 +627,7 @@ "name": "roles/hana_update/tasks/hdb_version.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "796fdfa165cbb3c4ab456b77cb755bd29c2d6a1fc07d0a52ee148d5688a4fac1", + "chksum_sha256": "3a47d03c2deef4c21e70d127720c0dca71cc26b96ebcca5baaca831ff4c24a48", "format": 1 }, { @@ -403,14 +641,14 @@ "name": "roles/hana_update/tasks/hdb_update.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "b2f547485d854a75b824c98c78097e32903ce54133da9de826681fc0de4eab1f", + "chksum_sha256": "5f099262102495429a80a9637fe3f41a80a64d7b2dfa09d6d600332b9bab5506", "format": 1 }, { "name": "roles/hana_update/tasks/argument_validate.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "f0ea12ddaec4bb14cce7199e1e64288148eb5896c20c6a4abec3eaa04f8d3851", + "chksum_sha256": "f340379388e11cb69b1b3af237fbcf4c3ce81c491757cd116da9e3fe2d42e495", "format": 1 }, { @@ -424,7 +662,7 @@ "name": "roles/hana_update/tasks/requirements_validate.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "3308c0791bab087e7cf808e183d367842c5076ca49e6dd439717742fcc415488", + "chksum_sha256": "49ee40e8a0a3840065cdbe444ac0a0cca745503c3bd1f276d2bf67787dc4f406", "format": 1 }, { @@ -543,7 +781,7 @@ "name": "roles/unpack/tasks/prerequisites.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "fff74cac36af574ae0cb55bcbc17036e7bbc1569f3373fcf71e37affea2bcfca", + "chksum_sha256": "c69b106f6faf8ac7212eb5245b6d4a7ffc4185b67c58e7f66be3c581d36a1eec", "format": 1 }, { @@ -578,7 +816,7 @@ "name": "roles/unpack/meta/main.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d839b4038af00e95a4c6e1fbfc0952dd465648ed1a126f87bb0ac48f70f2de28", + "chksum_sha256": "ea4f8407f6940f1aea9a1b17b5e979d3f498a46c77328d77e8d53fd425c2d073", "format": 1 }, { @@ -620,14 +858,14 @@ "name": "README.md", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "522b887a467a6158dc8a1a099b20c7acd8b7fc2a9298a1ce56ef7cb7327bf5df", + "chksum_sha256": "9dc4b0f8c2f6488867366b00c632784655631bc73aed7dcc35f3f783a89c9abc", "format": 1 }, { "name": "CHANGELOG.rst", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "7973896259b55f317f0eca97c996627d286f7c60a67e1b08b27b475049f7763f", + "chksum_sha256": "0d920bf67d57a0ffad9f57ab9fd9fda05f6a88c1d9bf9f40621962606da2f4b9", "format": 1 } ], diff --git a/MANIFEST.json b/MANIFEST.json index 61f2590..e6a707f 100644 --- a/MANIFEST.json +++ b/MANIFEST.json @@ -2,7 +2,7 @@ "collection_info": { "namespace": "sap", "name": "sap_operations", - "version": "1.0.5", + "version": "1.1.0", "authors": [ "Ondra Machacek ", "Kirill Satarin (@kksat)" @@ -27,7 +27,7 @@ "name": "FILES.json", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "d8844f43abb853b289e1475dd72e19800f63b65a4dc36d0b523d0d6a060e442c", + "chksum_sha256": "f1639fe761deff69a6e8317213fd8601a53dfd48bc7c75253ad52289c5764d57", "format": 1 }, "format": 1 diff --git a/README.md b/README.md index aac24fd..a71c112 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,25 @@ ansible-galaxy collection install sap.sap_operations Role `prepare` will make sure that all necesary package dependencies are installed on RHEL host, so content from this collection can be executed. Please see documentation for role `prepare`. + +## Requirements + +### Ansible + +ansible-core 2.12 + +ansible-core 2.13 + +ansible-core 2.14 + +### Python + +Ansible Automation Platform requires at minimum Python 3.8 to function as designed. + +## LICENSE + +GPL2.0 + +APACHE-2 + +GPL3.0 diff --git a/galaxy.yml b/galaxy.yml index 683afb5..10ee29d 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -3,18 +3,18 @@ namespace: sap name: sap_operations -version: 1.0.5 +version: 1.1.0 readme: README.md authors: -- Ondra Machacek -- Kirill Satarin (@kksat) + - Ondra Machacek + - Kirill Satarin (@kksat) description: Ansible collection to handle day 2 operational SAP administration tasks. license: -- GPL-2.0-or-later + - GPL-2.0-or-later license_file: '' @@ -48,4 +48,4 @@ build_ignore: - requirements-dev.txt - changelogs - .vscode - - .ansible-lint-ignore + - venv diff --git a/plugins/doc_fragments/saphost.py b/plugins/doc_fragments/saphost.py new file mode 100644 index 0000000..e7e1e60 --- /dev/null +++ b/plugins/doc_fragments/saphost.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2023 Red Hat, Inc. Project Atmosphere +# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# +# Copyright (c) 2023 Red Hat, Inc. Project Atmosphere +# +# This program is free software: you can redistribute it and/or modify it under the terms of the GNU +# General Public License as published by the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with this program. +# If not, see . + + +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + + +class ModuleDocFragment(object): + DOCUMENTATION = r""" +--- +description: + - SAP start framework is used to collect information and perform actions from host level + +author: + - Kirill Satarin (@kksat) + - Ondra Machacek (@machacekondra) + +requirements: + - python >= 3.6 + - pyrfc >= 2.7.0 + +options: + username: + description: + - "I(username) of the OS user that will connect to SAP host agent web services (sapadm, or adm, or any other user with necessary permissions)" + - Parameters I(username) I(password) and I(hostname) should be provided together. + type: str + password: + description: + - "I(password) of the OS user that will connect to SAP host agent web services (sapadm, or adm, or any other user with necessary permissio" + - Parameters I(username) I(password) and I(hostname) should be provided together. + type: str + hostname: + description: + - "I(hostname) of the SAP system, will be used to connect to SAP host agent web services" + - Parameters I(username) I(password) and I(hostname) should be provided together. + type: str + ca_file: + description: + - "I(ca_file) - path to file with CA certificate to secure the communication. if not provided system CA store is used." + - "Required if I(security) is set to C(custom)" + type: path + security: + description: + - Parameter I(security) specifies how secure communication should be enforced. + - By default system CA (certification authority) store is used (parameter value is C(system)). + - If custom CA (certification authority) has to be used, parameter I(ca_file) should be set to path to CA public certificate. + - If set to C(none) https communication is possible, but server certificate will not be checked for trust. + choices: ['system', 'custom', 'none'] + default: system + type: str + """ diff --git a/plugins/module_utils/saphost.py b/plugins/module_utils/saphost.py new file mode 100644 index 0000000..1ee8956 --- /dev/null +++ b/plugins/module_utils/saphost.py @@ -0,0 +1,324 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2022 Red Hat, Inc. +# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# +# Copyright 2023 Red Hat, Project Atmosphere +# +# This program is free software: you can redistribute it and/or modify it under the terms of the GNU +# General Public License as published by the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with this program. +# If not, see . + + +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + +import socket +import ssl +import traceback +import urllib.request + +from ansible.module_utils.basic import missing_required_lib +from ansible.module_utils.basic import AnsibleModule + +try: + from http.client import HTTPConnection +except ImportError: + from httplib import HTTPConnection + +try: + from suds.client import Client + from suds.transport.http import HttpAuthenticated, HttpTransport +except (ImportError, NameError): + # To avoid import error + HttpAuthenticated = object + HttpTransport = object + HAS_SUDS_LIBRARY = False + SUDS_LIBRARY_IMPORT_ERROR = traceback.format_exc() +else: + SUDS_LIBRARY_IMPORT_ERROR = None + HAS_SUDS_LIBRARY = True + SUDS_LIBRARY_IMPORT_ERROR = None + + +class C(object): + SAPHOSTCTRL = "saphostcrtl" + SAPCONTROL = "sapcontrol" + + +class SAPControl(object): + YELLOW = ("SAPControl-YELLOW",) # In transition + GREEN = ("SAPControl-GREEN",) # Running + RED = ("SAPControl-RED",) # Failure + GRAY = ("SAPControl-GRAY",) # Stopped + + +class SAPHostSecurity(object): + NONE = "none" + SYSTEM = "system" + CUSTOM = "custom" + + +# TODO add unit tests for convert2ansible +def convert2ansible(obj): + if hasattr(obj, "item"): + if hasattr(obj.item[0], "mKey") and hasattr(obj.item[0], "mValue"): + ret = {} + for element in obj.item: + ret[element["mKey"]] = convert2ansible(element["mValue"]) + return ret + return [convert2ansible(element) for element in obj.item] + if hasattr(obj, "__dict__"): + return { + k: convert2ansible(v) + for k, v in obj.__dict__.items() + if not k.startswith("__") + } + return obj + + +class LocalSocketHttpConnection(HTTPConnection): + def __init__( + self, + host, + port=None, + timeout=socket._GLOBAL_DEFAULT_TIMEOUT, + source_address=None, + socketpath=None, + ): + super().__init__(host, port, timeout, source_address) + self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + self.sock.connect(socketpath) + + +class LocalSocketHandler(urllib.request.HTTPHandler): + def __init__( + self, + debuglevel=0, + socketpath=None, + ): + self._debuglevel = debuglevel + self._socketpath = socketpath + + def http_open(self, req): + return self.do_open(LocalSocketHttpConnection, req, socketpath=self._socketpath) + + +class LocalSocketHttpAuthenticated(HttpAuthenticated): + def __init__(self, socketpath, **kwargs): + HttpAuthenticated.__init__(self, **kwargs) + self._socketpath = socketpath + + def u2handlers(self): + handlers = HttpTransport.u2handlers(self) + handlers.append(LocalSocketHandler(socketpath=self._socketpath)) + return handlers + + +class SAPHostSOAPClient(object): + """ + Class to call soap methods that are provided by sap host agent binaries, for instance + sapcontrol + saphostctrl + As there are slighly different approaches how to call methods provided by these binaries, + Two child classes will handle method calls. + This class should not be used directly, only via child classes. + + Methods are lookedup via __getattr__(), if method is not found, exception will happen, + this exception has to be handled by higher class. + """ + + poll_interval = 3 + + def __init__( + self, + hostname=None, + username=None, + password=None, + ca_file=None, + security=None, + instance=None, + binary=C.SAPHOSTCTRL, + ): + if not HAS_SUDS_LIBRARY: + self.fail_json( + msg=missing_required_lib("suds"), + exception=SUDS_LIBRARY_IMPORT_ERROR, + ) + self.hostname = hostname + self.username = username + self.password = password + self.instance = instance + self.ca_file = ca_file + self.security = security + self.secure_port = ( + "1129" if binary == C.SAPHOSTCTRL else f"5{str(instance).zfill(2)}14" + ) + self.unsecure_port = ( + "1128" if binary == C.SAPHOSTCTRL else f"5{str(instance).zfill(2)}13" + ) + self.unix_socket = ( + "/tmp/.sapstream1128" + if binary == C.SAPHOSTCTRL + else f"/tmp/.sapstream5{str(self.instance).zfill(2)}13" + ) + self.local = False if self.hostname else True + self.protocol = "http" if self.security == SAPHostSecurity.NONE else "https" + self.port = ( + self.unsecure_port + if self.security == SAPHostSecurity.NONE + else self.secure_port + ) + if self.local: + if binary == C.SAPHOSTCTRL: + self.url = f"http://localhost:{self.port}/SAPHostControl/?wsdl" + else: + self.url = "http://localhost/sapcontrol?wsdl" + else: + if binary == C.SAPHOSTCTRL: + self.url = f"{self.protocol}://{self.hostname}:{self.port}/SAPHostControl/?wsdl" + else: + self.url = ( + f"{self.protocol}://{self.hostname}:{self.port}/sapcontrol?wsdl" + ) + self.client = None + + self.connect() + + def connect(self): + if self.local: + return self._connect_local() + + return self._connect_http() + + def _connect_local(self): + try: + localsocket = LocalSocketHttpAuthenticated(self.unix_socket) + client = Client(self.url, transport=localsocket) + except Exception as e: + raise e + + self.client = client + + def _connect_http(self): + if self.security == SAPHostSecurity.SYSTEM: + if self.ca_file is not None: + ssl._create_default_https_context = lambda: ssl.create_default_context( + cafile=self.ca_file + ) + elif self.security == SAPHostSecurity.CUSTOM: + if self.ca_file is not None: + ssl._create_default_https_context = ( + lambda: ssl._create_unverified_context(cafile=self.ca_file) + ) + try: + client = Client(self.url, username=self.username, password=self.password) + except Exception as e: + raise Exception(str(e) + self.url) + + self.client = client + + +class AnsibleModuleSAPHostAgent(AnsibleModule): + def __init__( + self, + argument_spec, + bypass_checks=False, + no_log=False, + mutually_exclusive=None, + required_together=None, + required_one_of=None, + add_file_common_args=False, + supports_check_mode=False, + required_if=None, + required_by=None, + ): + saphostagent_argument_spec = dict( + hostname=dict(type="str", required=False), + username=dict(type="str", required=False), + password=dict(type="str", no_log=True, required=False), + ca_file=dict( + type="path", + required=False, + required_by={"security": (SAPHostSecurity.CUSTOM,)}, + ), + security=dict( + type="str", + default=SAPHostSecurity.SYSTEM, + required=False, + choices=[ + SAPHostSecurity.SYSTEM, + SAPHostSecurity.CUSTOM, + SAPHostSecurity.NONE, + ], + ), + ) + + saphostagent_required_together = [ + ("hostname", "username", "password"), + ] + saphostagent_required_if = [ + ("security", SAPHostSecurity.CUSTOM, ("ca_file",)), + ] + saphostagent_required_by = {"hostname": ("username", "password")} + if required_together is not None: + required_together = required_together + saphostagent_required_together + else: + required_together = saphostagent_required_together + if required_if is not None: + required_if = required_if + saphostagent_required_if + else: + required_if = saphostagent_required_if + if required_by is not None: + required_by = {**required_by, **saphostagent_required_by} + else: + required_by = saphostagent_required_by + + super().__init__( + argument_spec={**argument_spec, **saphostagent_argument_spec}, + bypass_checks=bypass_checks, + no_log=no_log, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + required_one_of=required_one_of, + add_file_common_args=add_file_common_args, + supports_check_mode=supports_check_mode, + required_if=required_if, + required_by=required_by, + ) + # self.p = AnsibleParameters(self.params) + + +def saphostctrl( + hostname=None, username=None, password=None, ca_file=None, security=None +): + return SAPHostSOAPClient( + hostname=hostname, + username=username, + password=password, + ca_file=ca_file, + security=security, + binary=C.SAPHOSTCTRL, + ) + + +def sapcontrol( + instance, hostname=None, username=None, password=None, ca_file=None, security=None +): + return SAPHostSOAPClient( + hostname=hostname, + username=username, + password=password, + ca_file=ca_file, + security=security, + instance=instance, + binary=C.SAPCONTROL, + ) diff --git a/plugins/module_utils/soap.py b/plugins/module_utils/soap.py index 7d494f8..3c52e27 100644 --- a/plugins/module_utils/soap.py +++ b/plugins/module_utils/soap.py @@ -294,7 +294,7 @@ def get_system_instance(self, instance_host, instance_number): for inst in instance_list: if ( inst["hostname"] == instance_host - and inst["instanceNr"] == instance_number + and inst["instanceNr"] == instance_number # noqa: W503 ): return inst return dict() diff --git a/plugins/module_utils/valid_sid.py b/plugins/module_utils/valid_sid.py index bef152a..fdc2965 100644 --- a/plugins/module_utils/valid_sid.py +++ b/plugins/module_utils/valid_sid.py @@ -93,8 +93,8 @@ def valid_sid(sid): return ( (len(sid) == 3) - and (sid.upper() not in prohibited) - and (sid.upper() == sid) - and (sid[0] not in "0123456789") - and (sid.isalnum()) + and (sid.upper() not in prohibited) # noqa: W503 + and (sid.upper() == sid) # noqa: W503 + and (sid[0] not in "0123456789") # noqa: W503 + and (sid.isalnum()) # noqa: W503 ) diff --git a/plugins/modules/hana_backup.py b/plugins/modules/hana_backup.py index fc89208..c87876c 100644 --- a/plugins/modules/hana_backup.py +++ b/plugins/modules/hana_backup.py @@ -35,6 +35,7 @@ description: | Path to hdbsql binary. type: str + default: "" host: description: - Name of the host on which the database instance is running. @@ -72,17 +73,20 @@ description: - Comment to be included into backup. type: str + default: "" destination: description: | Directory where where backup data are stored for file backups. adm user should have write permissions to that directory. type: str + default: "" prefix: description: - The data backup files are prepended with the prefix. - Previous backup files will be overwritten if prefix was already used before (for file backups). type: str + default: "" wait: description: - Wait for the operation to complete before returning. diff --git a/plugins/modules/hdbuserstore.py b/plugins/modules/hdbuserstore.py index 861d5be..33639d7 100644 --- a/plugins/modules/hdbuserstore.py +++ b/plugins/modules/hdbuserstore.py @@ -36,6 +36,7 @@ See examples section to find several ways not to provide value for this variable. type: str required: false + default: '' key: description: - "Manage the I(key)." diff --git a/plugins/modules/hdbuserstore_info.py b/plugins/modules/hdbuserstore_info.py index d3fde77..9c4ca57 100644 --- a/plugins/modules/hdbuserstore_info.py +++ b/plugins/modules/hdbuserstore_info.py @@ -33,6 +33,7 @@ - "Custom path of the I(hdbuserstore) binary." type: str required: false + default: '' key: description: - "Get info about the I(key)." diff --git a/plugins/modules/host_info.py b/plugins/modules/host_info.py new file mode 100644 index 0000000..88ee655 --- /dev/null +++ b/plugins/modules/host_info.py @@ -0,0 +1,1371 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2023 Red Hat, Inc. Project Atmosphere +# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) +# +# Copyright (c) 2023 Red Hat, Inc. Project Atmosphere +# +# This program is free software: you can redistribute it and/or modify it under the terms of the GNU +# General Public License as published by the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with this program. +# If not, see . + + +from __future__ import absolute_import, division, print_function + +__metaclass__ = type + +DOCUMENTATION = r""" +--- +module: host_info +extends_documentation_fragment: + - sap.sap_operations.saphost + +author: + - Kirill Satarin (@kksat) + +short_description: Collect information about installed SAP instances on the host + +description: + - Collect information about installed SAP instances on the host + +options: {} + +version_added: 1.1.0 +""" + +EXAMPLES = r""" +- name: Collection information about SAP instances installed on the current host + sap.sap_operations.host_info: + +- name: Collection information about SAP instances installed on the remote host + sap.sap_operations.host_info: + username: sapadm + password: "secret123!" + hostname: "sap.system.example.com" +""" + +RETURN = r""" +instances: + description: SAP Instances installed on a host + type: list + returned: success + sample: |- + [ + { + "mSid": "NPL", + "mHostname": "vhcalnplci", + "mSystemNumber": "00", + "mSapVersionInfo": "749, patch 10, changelist 1698137", + "VersionInfo": + [ + { + "Filename": "/usr/sap/NPL/D00/exe/sapstartsrv", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/disp+work", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/gwrd", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/msg_server", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/dboraslib.so", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/dbmssslib.so", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/dbdb2slib.so", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/dbdb4slib.so", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/dbdb6slib.so", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/dbsybslib.so", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/enserver", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/enq_server", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/icman", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/sapwebdisp", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/jcontrol", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/jlaunch", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/D00/exe/jstart", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + } + ], + "InstanceProperties": + [ + { + "property": "Process List", + "propertytype": "NodeWebmethod", + "value": "GetProcessList" + }, + { + "property": "Access Points", + "propertytype": "NodeWebmethod", + "value": "GetAccessPointList" + }, + { + "property": "Parameter Documentation", + "propertytype": "NodeURL", + "value": "http://vhcalnplci:50013/sapparamEN.html" + }, + { + "property": "Kernel Update", + "propertytype": "NodeURL", + "value": "http://service.sap.com/~form/handler?_APP=00200682500000001943&_EVENT=DISPHIER&HEADER=Y&FUNCTIONBAR=N&EVENT=TREE&NE=NAVIGATE&ENR=73554900100200004760&V=MAINT" + }, + { + "property": "Current Status", + "propertytype": "NodeWebmethod", + "value": "GetAlertTree" + }, + { + "property": "Open Alerts", + "propertytype": "NodeWebmethod", + "value": "GetAlertTree" + }, + { + "property": "Syslog", + "propertytype": "NodeWebmethod", + "value": "ABAPReadSyslog" + }, + { + "property": "Queue Statistic", + "propertytype": "NodeWebmethod", + "value": "GetQueueStatistic" + }, + { + "property": "ABAP WP Table", + "propertytype": "NodeWebmethod", + "value": "ABAPGetWPTable" + }, + { + "property": "ICM", + "propertytype": "NodeURL", + "value": "HTTP://vhcalnplci:8000/sap/admin/public/index.html" + }, + { + "property": "ICM Threads", + "propertytype": "NodeWebmethod", + "value": "ICMGetThreadList" + }, + { + "property": "ICM Connections", + "propertytype": "NodeWebmethod", + "value": "ICMGetConnectionList" + }, + { + "property": "ICM Cache", + "propertytype": "NodeWebmethod", + "value": "ICMGetCacheEntries" + }, + { + "property": "ICM Proxy Connections", + "propertytype": "NodeWebmethod", + "value": "ICMGetProxyConnectionList" + }, + { + "property": "ABAP DB Connection", + "propertytype": "Attribute", + "value": "Database=SYBASE,DBHost=wdflbmd16697,DBName=NPL,DBPort=4901" + }, + { + "property": "Protected Webmethods", + "propertytype": "Attribute", + "value": "ABAPAcknowledgeAlerts,ABAPCheckRFCDestinations,ABAPGetComponentList,ABAPGetSystemWPTable,ABAPGetWPTable,ABAPReadRawSyslog,ABAPReadSyslog,AnalyseLogFiles,Bootstrap,CheckParameter,CheckPSE,CheckUpdateSystem,ConfigureLogFileList,CreatePSECredential,CreateSnapshot,DeletePSE,DeleteSnapshots,EnqGetLockTable,EnqGetStatistic,EnqRemoveLocks,EnqRemoveUserLocks,GetAccessPointList,GetAlerts,GetAlertTree,GetCallstack,GetEnvironment,GetLogFileList,GetProcessParameter,GetQueueStatistic,GetStartProfile,GetSystemUpdateList,GetTraceFile,GetVersionInfo,HACheckConfig,HACheckFailoverConfig,HAFailoverToNode,HAGetFailoverConfig,HASetMaintenanceMode,ICMGetCacheEntries,ICMGetConnectionList,ICMGetProxyConnectionList,ICMGetThreadList,InstanceStart,InstanceStop,J2EEControlCluster,J2EEControlComponents,J2EEControlProcess,J2EEDisableDbgSession,J2EEEnableDbgSession,J2EEGetApplicationAliasList,J2EEGetCacheStatistic,J2EEGetCacheStatistic2,J2EEGetClusterMsgList,J2EEGetComponentList,J2EEGetEJBSessionList,J2EEGetProcessList,J2EEGetProcessList2,J2EEGetRemoteObjectList,J2EEGetSessionList,J2EEGetSharedTableInfo,J2EEGetThreadCallStack,J2EEGetThreadList,J2EEGetThreadList2,J2EEGetThreadTaskStack,J2EEGetVMGCHistory,J2EEGetVMGCHistory2,J2EEGetVMHeapInfo,J2EEGetWebSessionList,J2EEGetWebSessionList2,ListDeveloperTraces,ListLogFiles,ListSnapshots,OSExecute,ParameterValue,ReadDeveloperTrace,ReadLogFile,ReadSnapshot,RestartInstance,RestartService,RestartSystem,SendSignal,SetProcessParameter,SetProcessParameter2,ShmDetach,Shutdown,Start,StartBypassHA,StartSystem,Stop,StopBypassHA,StopService,StopSystem,StorePSE,UpdateInstancePSE,UpdateSCSInstance,UpdateSystem,UpdateSystemPKI,WebDispGetServerList,WebDispGetGroupList,WebDispGetVirtHostList,WebDispGetUrlPrefixList,GetAgentConfig,MtChangeStatus,MtCustomizeWrite,MtDbsetToWpsetByTid,MtDestroyMarkNTry,MtReset,PerfCustomizeWrite,ReadDirectory,ReadFile,ReadProfileParameters,Register,SnglmgsCustomizeWrite,SystemObjectSetValue,ToolSet,ToolSetRuntimeStatus,TriggerDataCollection,Unregister,UtilAlChangeStatus" + }, + { + "property": "StartPriority", + "propertytype": "Attribute", + "value": "3" + }, + { + "property": "SAPSYSTEM", + "propertytype": "Attribute", + "value": "00" + }, + { + "property": "SAPSYSTEMNAME", + "propertytype": "Attribute", + "value": "NPL" + }, + { + "property": "SAPLOCALHOST", + "propertytype": "Attribute", + "value": "vhcalnplci" + }, + { + "property": "INSTANCE_NAME", + "propertytype": "Attribute", + "value": "D00" + }, + { + "property": "IGS", + "propertytype": "NodeURL", + "value": "http://vhcalnplci:40080" + }, + { + "property": "Webmethods", + "propertytype": "Attribute", + "value": "Start,InstanceStart,StartBypassHA,Bootstrap,Stop,InstanceStop,StopBypassHA,Shutdown,ParameterValue,GetProcessList,GetStartProfile,GetTraceFile,GetAlertTree,GetAlerts,RestartService,StopService,GetEnvironment,ListDeveloperTraces,ReadDeveloperTrace,RestartInstance,SendSignal,GetVersionInfo,GetQueueStatistic,GetInstanceProperties,OSExecute,ReadLogFile,AnalyseLogFiles,ListLogFiles,GetAccessPointList,GetSystemInstanceList,GetSystemUpdateList,StartSystem,StopSystem,RestartSystem,UpdateSystem,UpdateSCSInstance,CheckUpdateSystem,AccessCheck,GetProcessParameter,SetProcessParameter,SetProcessParameter2,CheckParameter,ShmDetach,GetNetworkId,GetSecNetworkId,RequestLogonFile,CreateSnapshot,ReadSnapshot,ListSnapshots,DeleteSnapshots,GetCallstack,ABAPReadSyslog,ABAPReadRawSyslog,ABAPGetWPTable,ABAPAcknowledgeAlerts,ABAPGetComponentList,ABAPCheckRFCDestinations,ABAPGetSystemWPTable,J2EEGetProcessList,J2EEGetProcessList2,J2EEControlProcess,J2EEGetThreadList,J2EEGetThreadList2,J2EEGetThreadCallStack,J2EEGetThreadTaskStack,J2EEGetSessionList,J2EEGetWebSessionList,J2EEGetWebSessionList2,J2EEGetCacheStatistic,J2EEGetCacheStatistic2,J2EEGetApplicationAliasList,J2EEGetVMGCHistory,J2EEGetVMGCHistory2,J2EEGetVMHeapInfo,J2EEGetEJBSessionList,J2EEGetRemoteObjectList,J2EEGetClusterMsgList,J2EEGetSharedTableInfo,J2EEGetComponentList,J2EEControlComponents,ICMGetThreadList,ICMGetConnectionList,ICMGetCacheEntries,ICMGetProxyConnectionList,WebDispGetServerList,WebDispGetGroupList,WebDispGetVirtHostList,WebDispGetUrlPrefixList,EnqGetLockTable,EnqRemoveLocks,EnqRemoveUserLocks,EnqGetStatistic,UpdateSystemPKI,UpdateInstancePSE,StorePSE,DeletePSE,CheckPSE,HACheckConfig,HACheckFailoverConfig,HAGetFailoverConfig,HAFailoverToNodeHASetMaintenanceMode" + } + ], + "ProcessList": + [ + { + "name": "disp+work", + "description": "Dispatcher", + "dispstatus": "SAPControl-GREEN", + "textstatus": "Running", + "starttime": "2023 04 14 05:32:59", + "elapsedtime": "1:43:26", + "pid": 3457 + }, + { + "name": "igswd_mt", + "description": "IGS Watchdog", + "dispstatus": "SAPControl-GREEN", + "textstatus": "Running", + "starttime": "2023 04 14 05:32:59", + "elapsedtime": "1:43:26", + "pid": 3458 + }, + { + "name": "gwrd", + "description": "Gateway", + "dispstatus": "SAPControl-GREEN", + "textstatus": "Running", + "starttime": "2023 04 14 05:33:01", + "elapsedtime": "1:43:24", + "pid": 3476 + }, + { + "name": "icman", + "description": "ICM", + "dispstatus": "SAPControl-GREEN", + "textstatus": "Running", + "starttime": "2023 04 14 05:33:01", + "elapsedtime": "1:43:24", + "pid": 3477 + } + ], + "AccessPointList": + [ + { + "address": "127.0.0.1", + "port": 8000, + "protocol": "HTTP", + "processname": "icm", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 8000, + "protocol": "HTTP", + "processname": "icm", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 44300, + "protocol": "HTTPS", + "processname": "icm", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 44300, + "protocol": "HTTPS", + "processname": "icm", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 0, + "protocol": "SMTP", + "processname": "icm", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 0, + "protocol": "SMTP", + "processname": "icm", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 8101, + "protocol": "HTTP", + "processname": "icm", + "active": "No" + }, + { + "address": "10.0.0.234", + "port": 8101, + "protocol": "HTTP", + "processname": "icm", + "active": "No" + }, + { + "address": "127.0.0.1", + "port": 50000, + "protocol": "HTTP", + "processname": "icm", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 50000, + "protocol": "HTTP", + "processname": "icm", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 50001, + "protocol": "HTTPS", + "processname": "icm", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 50001, + "protocol": "HTTPS", + "processname": "icm", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 50013, + "protocol": "HTTP", + "processname": "sapstartsrv", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 50013, + "protocol": "HTTP", + "processname": "sapstartsrv", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 50014, + "protocol": "HTTPS", + "processname": "sapstartsrv", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 50014, + "protocol": "HTTPS", + "processname": "sapstartsrv", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 3300, + "protocol": "RFC", + "processname": "gwrd", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 3300, + "protocol": "RFC", + "processname": "gwrd", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 4800, + "protocol": "RFC SNC", + "processname": "gwrd", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 4800, + "protocol": "RFC SNC", + "processname": "gwrd", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 3200, + "protocol": "DPTM", + "processname": "disp+work", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 3200, + "protocol": "DPTM", + "processname": "disp+work", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 40000, + "protocol": "IGS", + "processname": "igsmux", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 40000, + "protocol": "IGS", + "processname": "igsmux", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 40080, + "protocol": "HTTP", + "processname": "igsmux", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 40080, + "protocol": "HTTP", + "processname": "igsmux", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 40001, + "protocol": "IGS", + "processname": "igspw", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 40001, + "protocol": "IGS", + "processname": "igspw", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 40002, + "protocol": "IGS", + "processname": "igspw", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 40002, + "protocol": "IGS", + "processname": "igspw", + "active": "Yes" + } + ], + "Environment": + { + "LOGNAME": "npladm", + "HOME": "/home/npladm", + "SHELL": "/bin/csh", + "TERM": "vt100", + "PATH": "/home/npladm/bin:/usr/local/bin:/bin:/usr/bin:/usr/lib/mit/bin:/usr/sap/NPL/SYS/exe/uc/linuxx86_64:/usr/sap/NPL/SYS/exe/run:/home/npladm:/sybase/NPL/ASE-16_0/jobscheduler/bin:/sybase/NPL/ASE-16_0/bin:/sybase/NPL/ASE-16_0/install:/sybase/NPL/OCS-16_0/bin:", + "HOSTTYPE": "x86_64", + "VENDOR": "unknown", + "OSTYPE": "linux", + "MACHTYPE": "x86_64-suse-linux", + "SHLVL": "1", + "PWD": "/home/npladm", + "USER": "npladm", + "GROUP": "sapsys", + "HOST": "sid-npl", + "CSHEDIT": "emacs", + "MAIL": "/var/spool/mail/npladm", + "CPU": "x86_64", + "HOSTNAME": "sid-npl", + "LESS": "-M -I -R", + "LESSOPEN": "lessopen.sh %s", + "LESSCLOSE": "lessclose.sh %s %s", + "LESS_ADVANCED_PREPROCESSOR": "no", + "LESSKEY": "/etc/lesskey.bin", + "PAGER": "less", + "MORE": "-sl", + "MINICOM": "-c on", + "MANPATH": "/usr/local/man:/usr/share/man", + "XKEYSYMDB": "/usr/X11R6/lib/X11/XKeysymDB", + "XNLSPATH": "/usr/X11R6/lib/X11/nls", + "COLORTERM": "1", + "JAVA_BINDIR": "/usr/lib64/jvm/jre-1.8.0-ibm/bin", + "JAVA_ROOT": "/usr/lib64/jvm/jre-1.8.0-ibm", + "JAVA_HOME": "/usr/lib64/jvm/jre-1.8.0-ibm", + "JRE_HOME": "/usr/lib64/jvm/jre-1.8.0-ibm", + "JDK_HOME": "/usr/lib64/jvm/java-1_8_0-ibm-1.8.0", + "SDK_HOME": "/usr/lib64/jvm/java-1_8_0-ibm-1.8.0", + "XCURSOR_THEME": "DMZ", + "QT_SYSTEM_DIR": "/usr/share/desktop-data", + "LANG": "C.UTF-8", + "FROM_HEADER": "", + "WINDOWMANAGER": "xterm", + "XDG_DATA_DIRS": "/usr/local/share:/usr/share", + "XDG_CONFIG_DIRS": "/etc/xdg", + "G_BROKEN_FILENAMES": "1", + "CSHRCREAD": "true", + "LS_COLORS": "no", + "LS_OPTIONS": "-N --color", + "GPG_TTY": "/dev/pts/1", + "SAPSYSTEMNAME": "NPL", + "DIR_LIBRARY": "/usr/sap/NPL/SYS/exe/run", + "RSEC_SSFS_DATAPATH": "/usr/sap/NPL/SYS/global/security/rsecssfs/data", + "RSEC_SSFS_KEYPATH": "/usr/sap/NPL/SYS/global/security/rsecssfs/key", + "rsdb_ssfs_connect": "1", + "LD_LIBRARY_PATH": "/usr/sap/NPL/D00/exe:/usr/sap/NPL/SYS/exe/run:/usr/sap/NPL/SYS/exe/uc/linuxx86_64:/usr/sap/NPL/SYS/global/syb/linuxx86_64/sybodbc:/sybase/NPL/ASE-16_0/lib:/sybase/NPL/OCS-16_0/lib:/sybase/NPL/OCS-16_0/lib3p64:/sybase/NPL/OCS-16_0/lib3p:", + "INCLUDE": "/sybase/NPL/OCS-16_0/include:", + "LIB": "/sybase/NPL/OCS-16_0/lib:", + "SAP_JRE7_32": "/sybase/NPL/shared/SAPJRE-7_1_043_32BIT", + "SAP_JRE7": "/sybase/NPL/shared/SAPJRE-7_1_043_64BIT", + "SAP_JRE7_64": "/sybase/NPL/shared/SAPJRE-7_1_043_64BIT", + "SYBASE_OCS": "OCS-16_0", + "SYBASE": "/sybase/NPL", + "SYBASE_ASE": "ASE-16_0", + "SYBROOT": "/sybase/NPL", + "SYBASE_JRE_RTDS": "/sybase/NPL/shared/SAPJRE-7_1_043_64BIT", + "SYBASE_WS": "WS-16_0", + "dbms_type": "syb", + "dbs_syb_schema": "SAPSR3", + "dbs_syb_server": "wdflbmd16697", + "dbs_syb_dbname": "NPL", + "dbs_syb_port": "4901", + "dbs_syb_ssl": "0" + }, + "StartProfile": + { + "name": "/usr/sap/NPL/SYS/profile/NPL_D00_vhcalnplci", + "lines": + [ + "#.******************************************************************************************************************************", + "#.* *", + "#.* Instance profile NPL_D00_VHCALNPLCI *", + "#.* *", + "#.* Version = 000002 *", + "#.* Generated by user = DDIC *", + "#.* Generated on = 12.03.2023 , 19:56:00 *", + "#.* *", + "#.******************************************************************************************************************************", + "SAPSYSTEMNAME = NPL", + "SAPSYSTEM = 00", + "INSTANCE_NAME = D00", + "DIR_CT_RUN = $(DIR_EXE_ROOT)$(DIR_SEP)$(OS_UNICODE)$(DIR_SEP)linuxx86_64", + "DIR_EXECUTABLE = $(DIR_INSTANCE)/exe", + "SAPLOCALHOST = vhcalnplci", + "DIR_PROFILE = $(DIR_INSTALL)/profile", + "_PF = $(DIR_PROFILE)/NPL_D00_vhcalnplci", + "SETENV_00 = DIR_LIBRARY=$(DIR_LIBRARY)", + "SETENV_01 = LD_LIBRARY_PATH=$(DIR_LIBRARY):%(LD_LIBRARY_PATH)", + "SETENV_02 = SHLIB_PATH=$(DIR_LIBRARY):%(SHLIB_PATH)", + "SETENV_03 = LIBPATH=$(DIR_LIBRARY):%(LIBPATH)", + "SETENV_04 = PATH=$(DIR_EXECUTABLE):%(PATH)", + "#-----------------------------------------------------------------------", + "# Copy SAP Executables", + "#-----------------------------------------------------------------------", + "# Change for release 751", + "# Change for release 751", + "Execute_00 = immediate $(DIR_CT_RUN)$(DIR_SEP)sapcpe$(FT_EXE) pf=$(_PF)", + "# SYB change for release 751", + "Execute_01 = immediate $(DIR_CT_RUN)$(DIR_SEP)sapcpe$(FT_EXE) pf=$(_PFL) $(_CPE) $(_CPJDBC)", + "# SYB change for release 751", + "Execute_02 = immediate $(DIR_CT_RUN)$(DIR_SEP)sapcpe$(FT_EXE) pf=$(_PFL) $(_CPE) $(_CPODBC)", + "# SYB change for release 751", + "Execute_03 = immediate $(DIR_CT_RUN)$(DIR_SEP)sapcpe$(FT_EXE) pf=$(_PFL) $(_CPE) $(_CPJDBC)", + "# SYB change for release 751", + "Execute_04 = immediate $(DIR_CT_RUN)$(DIR_SEP)sapcpe$(FT_EXE) pf=$(_PFL) $(_CPE) $(_CPODBC)", + "# Change for release 751", + "#Execute_01 = immediate $(DIR_CT_RUN)$(DIR_SEP)sapcpe$(FT_EXE) pf=$(_PF)", + "# SYB change for release 751", + "Execute_06 = immediate $(DIR_CT_RUN)$(DIR_SEP)sapcpe$(FT_EXE) pf=$(_PFL) $(_CPE) $(_CPJDBC)", + "# SYB change for release 751", + "Execute_07 = immediate $(DIR_CT_RUN)$(DIR_SEP)sapcpe$(FT_EXE) pf=$(_PFL) $(_CPE) $(_CPODBC)", + "# SYB change for release 751", + "Execute_08 = immediate $(DIR_CT_RUN)$(DIR_SEP)sapcpe$(FT_EXE) pf=$(_PFL) $(_CPE) $(_CPJDBC)", + "# SYB change for release 751", + "Execute_09 = immediate $(DIR_CT_RUN)$(DIR_SEP)sapcpe$(FT_EXE) pf=$(_PFL) $(_CPE) $(_CPODBC)", + "# Change for release 751", + "#Execute_01 = immediate $(DIR_CT_RUN)/sapcpe$(FT_EXE) pf=$(_PF)", + "_CPARG0 = list:$(DIR_GLOBAL)/syb/linuxx86_64/cpe_sybjdbc.lst", + "_CPARG1 = source:$(DIR_GLOBAL)/syb/linuxx86_64", + "Execute_11 = immediate $(DIR_CT_RUN)/sapcpe$(FT_EXE) pf=$(_PF) $(_CPARG0) $(_CPARG1)", + "# Change for release 751", + "#Execute_03 = immediate $(DIR_CT_RUN)/sapcpe$(FT_EXE) pf=$(_PF)", + "_CPARG2 = list:$(DIR_GLOBAL)/syb/linuxx86_64/cpe_sybodbc.lst", + "_CPARG3 = source:$(DIR_GLOBAL)/syb/linuxx86_64/sybodbc", + "Execute_13 = immediate $(DIR_CT_RUN)/sapcpe$(FT_EXE) pf=$(_PF) $(_CPARG2) $(_CPARG3)", + "_CPARG4 = list:$(DIR_CT_RUN)/sapcrypto.lst", + "Execute_14 = immediate $(DIR_CT_RUN)/sapcpe$(FT_EXE) pf=$(_PF) $(_CPARG4)", + "#-----------------------------------------------------------------------", + "# Start ABAP database", + "#-----------------------------------------------------------------------", + "Execute_15 = immediate $(DIR_CT_RUN)/startdb", + "exe/saposcol = $(DIR_CT_RUN)/saposcol", + "rdisp/wp_no_dia = 6", + "rdisp/wp_no_btc = 4", + "rdisp/wp_no_vb = 1", + "rdisp/wp_no_vb2 = 1", + "rdisp/wp_no_spo = 1", + "exe/icmbnd = $(DIR_CT_RUN)/icmbnd", + "#-----------------------------------------------------------------------", + "# Start SCSA administration", + "#-----------------------------------------------------------------------", + "Execute_16 = local $(DIR_EXECUTABLE)/sapmscsa pf=$(_PF) -n", + "#-----------------------------------------------------------------------", + "# Start application server", + "#-----------------------------------------------------------------------", + "_DW = dw.sap$(SAPSYSTEMNAME)_$(INSTANCE_NAME)", + "Execute_17 = local rm -f $(_DW)", + "Execute_18 = local ln -s -f $(DIR_EXECUTABLE)/disp+work$(FT_EXE) $(_DW)", + "Start_Program_00 = local $(_DW) pf=$(_PF)", + "#-----------------------------------------------------------------------", + "# Start internet graphics server", + "#-----------------------------------------------------------------------", + "_IG = ig.sap$(SAPSYSTEMNAME)_$(INSTANCE_NAME)", + "# Start IGS", + "#Execute_14 = local rm -f $(_IG)", + "# Start IGS", + "#Execute_15 = local ln -s -f $(DIR_EXECUTABLE)/igswd_mt $(_IG)", + "# Start IGS", + "# Start IGS", + "#Execute_21 = local rm -f $(_IG)", + "# Start IGS", + "# Start IGS", + "#Execute_22 = local ln -s -f $(DIR_EXECUTABLE)/igswd_mt $(_IG)", + "# Start IGS", + "Execute_23 = local rm -f $(_IG)", + "# Start IGS", + "Execute_24 = local ln -s -f $(DIR_EXECUTABLE)/igswd_mt $(_IG)", + "# Start IGS", + "#Start_Program_01 = local $(_IG) -mode=profile pf=$(_PF)", + "# Start IGS", + "# Start IGS", + "#Start_Program_02 = local $(_IG) -mode=profile pf=$(_PF)", + "# Start IGS", + "Start_Program_03 = local $(_IG) -mode=profile pf=$(_PF)", + "SETENV_05 = SECUDIR=$(DIR_INSTANCE)/sec", + "ipc/shm_psize_10 = 124000000", + "ipc/shm_psize_40 = 1722000000", + "# SYB change for release 751", + "_CPE = copy_links target:$(DIR_EXECUTABLE)", + "_SYBLST = $(DIR_GLOBAL)$(DIR_SEP)syb$(DIR_SEP)linuxx86_64", + "_DIRODBC = $(DIR_GLOBAL)$(DIR_SEP)syb$(DIR_SEP)linuxx86_64$(DIR_SEP)sybodbc", + "_CPJDBC = list:$(_SYBLST)$(DIR_SEP)cpe_sybjdbc.lst source:$(_SYBLST)", + "_CPODBC = list:$(_SYBLST)$(DIR_SEP)cpe_sybodbc.lst source:$(_DIRODBC)", + "_PFL = $(DIR_PROFILE)$(DIR_SEP)NPL_D00_vhcalnplci", + "SAPFQDN = dummy.nodomain", + "#SAPLOCALHOSTFULL = $(SAPLOCALHOST).$(SAPFQDN)", + "SAPLOCALHOSTFULL = $(SAPLOCALHOST).$(SAPFQDN)", + "icm/server_port_4 = PROT=HTTP, PORT=50000, PROCTIMEOUT=300, TIMEOUT=300", + "icm/server_port_5 = PROT=HTTPS, PORT=50001, PROCTIMEOUT=300, TIMEOUT=300", + "icm/server_port_2 = PROT=SMTP, PORT=0, PROCTIMEOUT=300, TIMEOUT=300", + "icm/server_port_3 = PROT=HTTP, PORT=8101, PROCTIMEOUT=300, TIMEOUT=300", + "abap/shared_objects_size_MB = 1024", + "PHYS_MEMSIZE = 30%", + "em/initial_size_MB = ($(PHYS_MEMSIZE)*0.7)", + "#abap/buffersize = (ceil($(em/initial_size_MB)*1024*0.15/4096)*4096)", + "gw/alternative_hostnames = abapci,abapci.dummy.nodomain", + "login/create_sso2_ticket = 2", + "login/accept_sso2_ticket = 1", + "icm/server_port_0 = PROT=HTTP,PORT=80$$,PROCTIMEOUT=600,TIMEOUT=600", + "icm/server_port_1 = PROT=HTTPS,PORT=443$$,PROCTIMEOUT=600,TIMEOUT=600" + ] + }, + "HAFailoverConfig": + { + "HAActive": false, + "HAProductVersion": null, + "HASAPInterfaceVersion": null, + "HADocumentation": null, + "HAActiveNode": null, + "HANodes": "" + } + }, + { + "mSid": "NPL", + "mHostname": "vhcalnplcs", + "mSystemNumber": "01", + "mSapVersionInfo": "749, patch 10, changelist 1698137", + "VersionInfo": + [ + { + "Filename": "/usr/sap/NPL/ASCS01/exe/sapstartsrv", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/ASCS01/exe/gwrd", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/ASCS01/exe/msg_server", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/ASCS01/exe/enserver", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/ASCS01/exe/enq_server", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + }, + { + "Filename": "/usr/sap/NPL/ASCS01/exe/sapwebdisp", + "VersionInfo": "749, patch 10, changelist 1698137, RKS compatibility level 0, optU (Aug 23 2016, 17:53:49), linuxx86_64", + "Time": "2022 08 19 08:37:20" + } + ], + "InstanceProperties": + [ + { + "property": "Process List", + "propertytype": "NodeWebmethod", + "value": "GetProcessList" + }, + { + "property": "Access Points", + "propertytype": "NodeWebmethod", + "value": "GetAccessPointList" + }, + { + "property": "Parameter Documentation", + "propertytype": "NodeURL", + "value": "http://vhcalnplcs:50113/sapparamEN.html" + }, + { + "property": "Kernel Update", + "propertytype": "NodeURL", + "value": "http://service.sap.com/~form/handler?_APP=00200682500000001943&_EVENT=DISPHIER&HEADER=Y&FUNCTIONBAR=N&EVENT=TREE&NE=NAVIGATE&ENR=73554900100200004760&V=MAINT" + }, + { + "property": "Syslog", + "propertytype": "NodeWebmethod", + "value": "ABAPReadSyslog" + }, + { + "property": "Enque Locks", + "propertytype": "NodeWebmethod", + "value": "EnqGetLockTable" + }, + { + "property": "Enque Statistic", + "propertytype": "NodeWebmethod", + "value": "EnqGetStatistic" + }, + { + "property": "Protected Webmethods", + "propertytype": "Attribute", + "value": "ABAPAcknowledgeAlerts,ABAPCheckRFCDestinations,ABAPGetComponentList,ABAPGetSystemWPTable,ABAPGetWPTable,ABAPReadRawSyslog,ABAPReadSyslog,AnalyseLogFiles,Bootstrap,CheckParameter,CheckPSE,CheckUpdateSystem,ConfigureLogFileList,CreatePSECredential,CreateSnapshot,DeletePSE,DeleteSnapshots,EnqGetLockTable,EnqGetStatistic,EnqRemoveLocks,EnqRemoveUserLocks,GetAccessPointList,GetAlerts,GetAlertTree,GetCallstack,GetEnvironment,GetLogFileList,GetProcessParameter,GetQueueStatistic,GetStartProfile,GetSystemUpdateList,GetTraceFile,GetVersionInfo,HACheckConfig,HACheckFailoverConfig,HAFailoverToNode,HAGetFailoverConfig,HASetMaintenanceMode,ICMGetCacheEntries,ICMGetConnectionList,ICMGetProxyConnectionList,ICMGetThreadList,InstanceStart,InstanceStop,J2EEControlCluster,J2EEControlComponents,J2EEControlProcess,J2EEDisableDbgSession,J2EEEnableDbgSession,J2EEGetApplicationAliasList,J2EEGetCacheStatistic,J2EEGetCacheStatistic2,J2EEGetClusterMsgList,J2EEGetComponentList,J2EEGetEJBSessionList,J2EEGetProcessList,J2EEGetProcessList2,J2EEGetRemoteObjectList,J2EEGetSessionList,J2EEGetSharedTableInfo,J2EEGetThreadCallStack,J2EEGetThreadList,J2EEGetThreadList2,J2EEGetThreadTaskStack,J2EEGetVMGCHistory,J2EEGetVMGCHistory2,J2EEGetVMHeapInfo,J2EEGetWebSessionList,J2EEGetWebSessionList2,ListDeveloperTraces,ListLogFiles,ListSnapshots,OSExecute,ParameterValue,ReadDeveloperTrace,ReadLogFile,ReadSnapshot,RestartInstance,RestartService,RestartSystem,SendSignal,SetProcessParameter,SetProcessParameter2,ShmDetach,Shutdown,Start,StartBypassHA,StartSystem,Stop,StopBypassHA,StopService,StopSystem,StorePSE,UpdateInstancePSE,UpdateSCSInstance,UpdateSystem,UpdateSystemPKI,WebDispGetServerList,WebDispGetGroupList,WebDispGetVirtHostList,WebDispGetUrlPrefixList,GetAgentConfig,MtChangeStatus,MtCustomizeWrite,MtDbsetToWpsetByTid,MtDestroyMarkNTry,MtReset,PerfCustomizeWrite,ReadDirectory,ReadFile,ReadProfileParameters,Register,SnglmgsCustomizeWrite,SystemObjectSetValue,ToolSet,ToolSetRuntimeStatus,TriggerDataCollection,Unregister,UtilAlChangeStatus" + }, + { + "property": "CentralServices", + "propertytype": "Attribute", + "value": "YES" + }, + { + "property": "StartPriority", + "propertytype": "Attribute", + "value": "1" + }, + { + "property": "SAPSYSTEM", + "propertytype": "Attribute", + "value": "01" + }, + { + "property": "SAPSYSTEMNAME", + "propertytype": "Attribute", + "value": "NPL" + }, + { + "property": "SAPLOCALHOST", + "propertytype": "Attribute", + "value": "vhcalnplcs" + }, + { + "property": "INSTANCE_NAME", + "propertytype": "Attribute", + "value": "ASCS01" + }, + { + "property": "SupportsUpdateSCSInstance", + "propertytype": "Attribute", + "value": "YES" + }, + { + "property": "Webmethods", + "propertytype": "Attribute", + "value": "Start,InstanceStart,StartBypassHA,Bootstrap,Stop,InstanceStop,StopBypassHA,Shutdown,ParameterValue,GetProcessList,GetStartProfile,GetTraceFile,GetAlertTree,GetAlerts,RestartService,StopService,GetEnvironment,ListDeveloperTraces,ReadDeveloperTrace,RestartInstance,SendSignal,GetVersionInfo,GetQueueStatistic,GetInstanceProperties,OSExecute,ReadLogFile,AnalyseLogFiles,ListLogFiles,GetAccessPointList,GetSystemInstanceList,GetSystemUpdateList,StartSystem,StopSystem,RestartSystem,UpdateSystem,UpdateSCSInstance,CheckUpdateSystem,AccessCheck,GetProcessParameter,SetProcessParameter,SetProcessParameter2,CheckParameter,ShmDetach,GetNetworkId,GetSecNetworkId,RequestLogonFile,CreateSnapshot,ReadSnapshot,ListSnapshots,DeleteSnapshots,GetCallstack,ABAPReadSyslog,ABAPReadRawSyslog,ABAPGetWPTable,ABAPAcknowledgeAlerts,ABAPGetComponentList,ABAPCheckRFCDestinations,ABAPGetSystemWPTable,J2EEGetProcessList,J2EEGetProcessList2,J2EEControlProcess,J2EEGetThreadList,J2EEGetThreadList2,J2EEGetThreadCallStack,J2EEGetThreadTaskStack,J2EEGetSessionList,J2EEGetWebSessionList,J2EEGetWebSessionList2,J2EEGetCacheStatistic,J2EEGetCacheStatistic2,J2EEGetApplicationAliasList,J2EEGetVMGCHistory,J2EEGetVMGCHistory2,J2EEGetVMHeapInfo,J2EEGetEJBSessionList,J2EEGetRemoteObjectList,J2EEGetClusterMsgList,J2EEGetSharedTableInfo,J2EEGetComponentList,J2EEControlComponents,ICMGetThreadList,ICMGetConnectionList,ICMGetCacheEntries,ICMGetProxyConnectionList,WebDispGetServerList,WebDispGetGroupList,WebDispGetVirtHostList,WebDispGetUrlPrefixList,EnqGetLockTable,EnqRemoveLocks,EnqRemoveUserLocks,EnqGetStatistic,UpdateSystemPKI,UpdateInstancePSE,StorePSE,DeletePSE,CheckPSE,HACheckConfig,HACheckFailoverConfig,HAGetFailoverConfig,HAFailoverToNodeHASetMaintenanceMode" + } + ], + "ProcessList": + [ + { + "name": "msg_server", + "description": "MessageServer", + "dispstatus": "SAPControl-GREEN", + "textstatus": "Running", + "starttime": "2023 04 14 05:31:52", + "elapsedtime": "1:44:33", + "pid": 2864 + }, + { + "name": "enserver", + "description": "EnqueueServer", + "dispstatus": "SAPControl-GREEN", + "textstatus": "Running", + "starttime": "2023 04 14 05:31:52", + "elapsedtime": "1:44:33", + "pid": 2865 + } + ], + "AccessPointList": + [ + { + "address": "127.0.0.1", + "port": 50113, + "protocol": "HTTP", + "processname": "sapstartsrv", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 50113, + "protocol": "HTTP", + "processname": "sapstartsrv", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 50114, + "protocol": "HTTPS", + "processname": "sapstartsrv", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 50114, + "protocol": "HTTPS", + "processname": "sapstartsrv", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 3201, + "protocol": "ENQ", + "processname": "enserver", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 3201, + "protocol": "ENQ", + "processname": "enserver", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 3901, + "protocol": "MS", + "processname": "msg_server", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 3901, + "protocol": "MS", + "processname": "msg_server", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 3601, + "protocol": "MS", + "processname": "msg_server", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 3601, + "protocol": "MS", + "processname": "msg_server", + "active": "Yes" + }, + { + "address": "127.0.0.1", + "port": 8101, + "protocol": "HTTP", + "processname": "msg_server", + "active": "Yes" + }, + { + "address": "10.0.0.234", + "port": 8101, + "protocol": "HTTP", + "processname": "msg_server", + "active": "Yes" + } + ], + "Environment": + { + "LOGNAME": "npladm", + "HOME": "/home/npladm", + "SHELL": "/bin/csh", + "TERM": "vt100", + "PATH": "/home/npladm/bin:/usr/local/bin:/bin:/usr/bin:/usr/lib/mit/bin:/usr/sap/NPL/SYS/exe/uc/linuxx86_64:/usr/sap/NPL/SYS/exe/run:/home/npladm:/sybase/NPL/ASE-16_0/jobscheduler/bin:/sybase/NPL/ASE-16_0/bin:/sybase/NPL/ASE-16_0/install:/sybase/NPL/OCS-16_0/bin:", + "HOSTTYPE": "x86_64", + "VENDOR": "unknown", + "OSTYPE": "linux", + "MACHTYPE": "x86_64-suse-linux", + "SHLVL": "1", + "PWD": "/home/npladm", + "USER": "npladm", + "GROUP": "sapsys", + "HOST": "sid-npl", + "CSHEDIT": "emacs", + "MAIL": "/var/spool/mail/npladm", + "CPU": "x86_64", + "HOSTNAME": "sid-npl", + "LESS": "-M -I -R", + "LESSOPEN": "lessopen.sh %s", + "LESSCLOSE": "lessclose.sh %s %s", + "LESS_ADVANCED_PREPROCESSOR": "no", + "LESSKEY": "/etc/lesskey.bin", + "PAGER": "less", + "MORE": "-sl", + "MINICOM": "-c on", + "MANPATH": "/usr/local/man:/usr/share/man", + "XKEYSYMDB": "/usr/X11R6/lib/X11/XKeysymDB", + "XNLSPATH": "/usr/X11R6/lib/X11/nls", + "COLORTERM": "1", + "JAVA_BINDIR": "/usr/lib64/jvm/jre-1.8.0-ibm/bin", + "JAVA_ROOT": "/usr/lib64/jvm/jre-1.8.0-ibm", + "JAVA_HOME": "/usr/lib64/jvm/jre-1.8.0-ibm", + "JRE_HOME": "/usr/lib64/jvm/jre-1.8.0-ibm", + "JDK_HOME": "/usr/lib64/jvm/java-1_8_0-ibm-1.8.0", + "SDK_HOME": "/usr/lib64/jvm/java-1_8_0-ibm-1.8.0", + "XCURSOR_THEME": "DMZ", + "QT_SYSTEM_DIR": "/usr/share/desktop-data", + "LANG": "C.UTF-8", + "FROM_HEADER": "", + "WINDOWMANAGER": "xterm", + "XDG_DATA_DIRS": "/usr/local/share:/usr/share", + "XDG_CONFIG_DIRS": "/etc/xdg", + "G_BROKEN_FILENAMES": "1", + "CSHRCREAD": "true", + "LS_COLORS": "no", + "LS_OPTIONS": "-N --color", + "GPG_TTY": "/dev/pts/1", + "SAPSYSTEMNAME": "NPL", + "DIR_LIBRARY": "/usr/sap/NPL/SYS/exe/run", + "RSEC_SSFS_DATAPATH": "/usr/sap/NPL/SYS/global/security/rsecssfs/data", + "RSEC_SSFS_KEYPATH": "/usr/sap/NPL/SYS/global/security/rsecssfs/key", + "rsdb_ssfs_connect": "1", + "LD_LIBRARY_PATH": "/usr/sap/NPL/ASCS01/exe:/usr/sap/NPL/SYS/exe/run:/usr/sap/NPL/SYS/exe/uc/linuxx86_64:/usr/sap/NPL/SYS/global/syb/linuxx86_64/sybodbc:/sybase/NPL/ASE-16_0/lib:/sybase/NPL/OCS-16_0/lib:/sybase/NPL/OCS-16_0/lib3p64:/sybase/NPL/OCS-16_0/lib3p:", + "INCLUDE": "/sybase/NPL/OCS-16_0/include:", + "LIB": "/sybase/NPL/OCS-16_0/lib:", + "SAP_JRE7_32": "/sybase/NPL/shared/SAPJRE-7_1_043_32BIT", + "SAP_JRE7": "/sybase/NPL/shared/SAPJRE-7_1_043_64BIT", + "SAP_JRE7_64": "/sybase/NPL/shared/SAPJRE-7_1_043_64BIT", + "SYBASE_OCS": "OCS-16_0", + "SYBASE": "/sybase/NPL", + "SYBASE_ASE": "ASE-16_0", + "SYBROOT": "/sybase/NPL", + "SYBASE_JRE_RTDS": "/sybase/NPL/shared/SAPJRE-7_1_043_64BIT", + "SYBASE_WS": "WS-16_0", + "dbms_type": "syb", + "dbs_syb_schema": "SAPSR3", + "dbs_syb_server": "wdflbmd16697", + "dbs_syb_dbname": "NPL", + "dbs_syb_port": "4901", + "dbs_syb_ssl": "0" + }, + "StartProfile": + { + "name": "/usr/sap/NPL/SYS/profile/NPL_ASCS01_vhcalnplcs", + "lines": + [ + "#.******************************************************************************************************************************", + "#.* *", + "#.* Instanzprofil NPL_ASCS01_VHCALNPLCS *", + "#.* *", + "#.* Version = 000001 *", + "#.* Generiert von Benutzer = DDIC *", + "#.* Datum der Generierung = 25.09.2017 , 07:43:55 *", + "#.* *", + "#.******************************************************************************************************************************", + "SAPSYSTEMNAME = NPL", + "SAPSYSTEM = 01", + "INSTANCE_NAME = ASCS01", + "DIR_CT_RUN = $(DIR_EXE_ROOT)$(DIR_SEP)$(OS_UNICODE)$(DIR_SEP)linuxx86_64", + "DIR_EXECUTABLE = $(DIR_INSTANCE)/exe", + "SAPLOCALHOST = vhcalnplcs", + "DIR_PROFILE = $(DIR_INSTALL)/profile", + "_PF = $(DIR_PROFILE)/NPL_ASCS01_vhcalnplcs", + "SETENV_00 = DIR_LIBRARY=$(DIR_LIBRARY)", + "SETENV_01 = LD_LIBRARY_PATH=$(DIR_LIBRARY):%(LD_LIBRARY_PATH)", + "SETENV_02 = SHLIB_PATH=$(DIR_LIBRARY):%(SHLIB_PATH)", + "SETENV_03 = LIBPATH=$(DIR_LIBRARY):%(LIBPATH)", + "SETENV_04 = PATH=$(DIR_EXECUTABLE):%(PATH)", + "#-----------------------------------------------------------------------", + "# Copy SAP Executables", + "#-----------------------------------------------------------------------", + "_CPARG0 = list:$(DIR_CT_RUN)/scs.lst", + "Execute_00 = immediate $(DIR_CT_RUN)/sapcpe$(FT_EXE) pf=$(_PF) $(_CPARG0)", + "_CPARG1 = list:$(DIR_CT_RUN)/sapcrypto.lst", + "Execute_01 = immediate $(DIR_CT_RUN)/sapcpe$(FT_EXE) pf=$(_PF) $(_CPARG1)", + "#-----------------------------------------------------------------------", + "# Start SAP message server", + "#-----------------------------------------------------------------------", + "_MS = ms.sap$(SAPSYSTEMNAME)_$(INSTANCE_NAME)", + "Execute_02 = local rm -f $(_MS)", + "Execute_03 = local ln -s -f $(DIR_EXECUTABLE)/msg_server$(FT_EXE) $(_MS)", + "Restart_Program_00 = local $(_MS) pf=$(_PF)", + "#-----------------------------------------------------------------------", + "# Start SAP enqueue server", + "#-----------------------------------------------------------------------", + "_EN = en.sap$(SAPSYSTEMNAME)_$(INSTANCE_NAME)", + "Execute_04 = local rm -f $(_EN)", + "Execute_05 = local ln -s -f $(DIR_EXECUTABLE)/enserver$(FT_EXE) $(_EN)", + "Restart_Program_01 = local $(_EN) pf=$(_PF)", + "#-----------------------------------------------------------------------", + "# SAP Message Server parameters are set in the DEFAULT.PFL", + "#-----------------------------------------------------------------------", + "ms/standalone = 1", + "ms/server_port_0 = PROT=HTTP,PORT=81$$", + "#-----------------------------------------------------------------------", + "# SAP Enqueue Server", + "#-----------------------------------------------------------------------", + "enque/table_size = 64000", + "enque/snapshot_pck_ids = 1600", + "enque/server/max_query_requests = 5000", + "enque/server/max_requests = 5000", + "enque/server/threadcount = 4", + "rdisp/enqname = $(rdisp/myname)", + "SETENV_05 = SECUDIR=$(DIR_INSTANCE)/sec", + "SAPFQDN = dummy.nodomain", + "SAPLOCALHOSTFULL = $(SAPLOCALHOST).$(SAPFQDN)" + ] + }, + "HAFailoverConfig": + { + "HAActive": false, + "HAProductVersion": null, + "HASAPInterfaceVersion": null, + "HADocumentation": null, + "HAActiveNode": null, + "HANodes": "" + } + } + ] + +databases: + description: SAP databases installed on a host + type: list + returned: success + sample: |- + [ + { + "mStatus": "SAPHostControl-DB-RUNNING", + "mDatabase": + { + "Database/InstanceName": "NPL", + "Database/Host": "sid-npl", + "Database/Vendor": "SYB", + "Database/Type": "syb", + "Database/Release": "16.0.02.05", + "Database/Name": "NPL", + "Database/Status": "Running" + }, + "mComponents": + [ + { + "mProperties": + { + "Database/ComponentName": "Client", + "Database/ComponentDescription": "SYBASE Server Client Software", + "Database/ComponentStatusDescription": "SAP ASE Server client software is configured properly." + }, + "mStatus": "SAPHostControl-DB-RUNNING" + }, + { + "mProperties": + { + "Database/ComponentName": "Server", + "Database/ComponentDescription": "SYBASE Server Software", + "Database/ComponentStatusDescription": "The database server is running and configured properly." + }, + "mStatus": "SAPHostControl-DB-RUNNING" + }, + { + "mProperties": + { + "Database/ComponentName": "Database", + "Database/ComponentDescription": "SYBASE Server Database", + "Database/ComponentStatusDescription": "The database is running and configured properly." + }, + "mStatus": "SAPHostControl-DB-RUNNING" + }, + { + "mProperties": + { + "Database/ComponentName": "Backup Server", + "Database/ComponentDescription": "SYBASE Backup Server Software", + "Database/ComponentStatusDescription": "Backup Server is running." + }, + "mStatus": "SAPHostControl-DB-RUNNING" + }, + { + "mProperties": + { + "Database/ComponentName": "Job Scheduler", + "Database/ComponentDescription": "SYBASE Job Scheduler", + "Database/ComponentStatusDescription": "Job Scheduler is running." + }, + "mStatus": "SAPHostControl-DB-RUNNING" + }, + { + "mProperties": + { + "Database/ComponentName": "RepAgent thread", + "Database/ComponentDescription": "SYBASE Replication Agent Thread", + "Database/ComponentStatusDescription": "Running Rep Agents: / Stopped Rep Agents:" + }, + "mStatus": "SAPHostControl-DB-RUNNING" + } + ], + "DatabaseProperties": + { + "Database/IsRelocationTarget": "true", + "Database/IsRelocatable": "true", + "Database/IsSharedInstance": "true", + "Database/IsSharedNetService": "true", + "Database/Capability/CopyMethods": "Offline, Online", + "Database/MaxPhysMemSize": "7812", + "Database/CPUCount": "4", + "Database/ConfigurationDirectory/Default": "/sybase/NPL/sapdbctrl-config", + "Database/DBRelease": "16.0.02.05", + "Database/DBSysBits": "64", + "Database/Distribution": "local", + "Database/ConnectAddress": "Protocol=tcp;Host=wdflbmd16697;Port=4901", + "Database/ManagementHosts": "wdflbmd16697" + }, + "DatabaseStatus": + { + "result": + [ + { + "mProperties": + { + "Database/ComponentName": "Client", + "Database/ComponentDescription": "SYBASE Server Client Software", + "Database/ComponentStatusDescription": "SAP ASE Server client software is configured properly." + }, + "mStatus": "SAPHostControl-DB-RUNNING" + }, + { + "mProperties": + { + "Database/ComponentName": "Server", + "Database/ComponentDescription": "SYBASE Server Software", + "Database/ComponentStatusDescription": "The database server is running and configured properly." + }, + "mStatus": "SAPHostControl-DB-RUNNING" + }, + { + "mProperties": + { + "Database/ComponentName": "Database", + "Database/ComponentDescription": "SYBASE Server Database", + "Database/ComponentStatusDescription": "The database is running and configured properly." + }, + "mStatus": "SAPHostControl-DB-RUNNING" + }, + { + "mProperties": + { + "Database/ComponentName": "Backup Server", + "Database/ComponentDescription": "SYBASE Backup Server Software", + "Database/ComponentStatusDescription": "Backup Server is running." + }, + "mStatus": "SAPHostControl-DB-RUNNING" + }, + { + "mProperties": + { + "Database/ComponentName": "Job Scheduler", + "Database/ComponentDescription": "SYBASE Job Scheduler", + "Database/ComponentStatusDescription": "Job Scheduler is running." + }, + "mStatus": "SAPHostControl-DB-RUNNING" + }, + { + "mProperties": + { + "Database/ComponentName": "RepAgent thread", + "Database/ComponentDescription": "SYBASE Replication Agent Thread", + "Database/ComponentStatusDescription": "Running Rep Agents: / Stopped Rep Agents:" + }, + "mStatus": "SAPHostControl-DB-RUNNING" + } + ], + "status": "SAPHostControl-DB-RUNNING" + } + } + ] +""" # noqa: E501 + +from ansible_collections.sap.sap_operations.plugins.module_utils.saphost import ( # pyright: ignore[reportMissingImports] + AnsibleModuleSAPHostAgent, + saphostctrl, + sapcontrol, + convert2ansible, +) + + +def main(): + module = AnsibleModuleSAPHostAgent(argument_spec={}, supports_check_mode=True) + + m = saphostctrl( + hostname=module.params.get("hostname"), + username=module.params.get("username"), + password=module.params.get("password"), + ca_file=module.params.get("ca_file"), + security=module.params.get("security"), + ) + try: + instances = convert2ansible(m.client.service.ListInstances()) + for instance in instances: + instance_sapcontrol = sapcontrol( + instance=instance["mSystemNumber"], + hostname=module.params.get("hostname"), + username=module.params.get("username"), + password=module.params.get("password"), + ca_file=module.params.get("ca_file"), + security=module.params.get("security"), + ) + + instance["VersionInfo"] = convert2ansible( + instance_sapcontrol.client.service.GetVersionInfo() + ) + instance["InstanceProperties"] = convert2ansible( + instance_sapcontrol.client.service.GetInstanceProperties() + ) + instance["ProcessList"] = convert2ansible( + instance_sapcontrol.client.service.GetProcessList() + ) + instance["AccessPointList"] = convert2ansible( + instance_sapcontrol.client.service.GetAccessPointList() + ) + instance["Environment"] = { + line.split("=")[0]: line.split("=")[1] + for line in convert2ansible( + instance_sapcontrol.client.service.GetEnvironment() + ) + } + instance["StartProfile"] = convert2ansible( + instance_sapcontrol.client.service.GetStartProfile() + ) + # instance['Snapshots'] = convert2ansible(instance_sapcontrol.client.service.ListSnapshots()) + # instance['GetProcessParameter'] = convert2ansible(instance_sapcontrol.client.service.GetProcessParameter()) + instance["HAFailoverConfig"] = convert2ansible( + instance_sapcontrol.client.service.HAGetFailoverConfig() + ) + + databases = convert2ansible(m.client.service.ListDatabases()) + for database in databases: + ArrayOfProperty = m.client.factory.create("ArrayOfProperty") + for property_key, property_value in database["mDatabase"].items(): + Property = m.client.factory.create("Property") + Property.mKey = property_key + Property.mValue = property_value + ArrayOfProperty.item.append(Property) + database["DatabaseProperties"] = convert2ansible( + m.client.service.GetDatabaseProperties(aArguments=ArrayOfProperty) + ) + database["DatabaseStatus"] = convert2ansible( + m.client.service.GetDatabaseStatus(aArguments=ArrayOfProperty) + ) + + # computer_system = convert2ansible(m.client.service.GetComputerSystem()) + # database_systems = convert2ansible(m.client.service.ListDatabaseSystems()) + + module.exit_json( + instances=instances, + databases=databases, + ) + except Exception as e: + module.fail_json( + msg="Issue during calling SOAP host agent methods", + exception=str(e), + ) + + +if __name__ == "__main__": + main() diff --git a/roles/hana_update/tasks/argument_validate.yml b/roles/hana_update/tasks/argument_validate.yml index ca602d4..6a2838e 100644 --- a/roles/hana_update/tasks/argument_validate.yml +++ b/roles/hana_update/tasks/argument_validate.yml @@ -1,3 +1,4 @@ +--- # # Copyright 2023 Red Hat, Project Atmosphere # diff --git a/roles/hana_update/tasks/hdb_update.yml b/roles/hana_update/tasks/hdb_update.yml index 63dd55b..1482f38 100644 --- a/roles/hana_update/tasks/hdb_update.yml +++ b/roles/hana_update/tasks/hdb_update.yml @@ -14,7 +14,7 @@ - name: Prepare necessary files for SAP HANA update vars: - random_code: "{{ lookup('ansible.builtin.password', '/dev/null chars=ascii_lowercase,digits length=8') }}" + random_code: "{{ lookup('ansible.builtin.password', '/dev/null chars=ascii_lowercase,digits length=8') }}" # noqa: var-naming[no-role-prefix] block: - name: Create HANA update configuration file from template ansible.builtin.template: @@ -38,9 +38,9 @@ become_user: root register: hana_update_hdb_passwords no_log: true -# TODO: More passwords required? -# See https://github.com/Azure/sap-automation/blob/experimental/deploy/ansible/ -# roles-db/4.0.0-hdb-install/templates/HANA_2_00_055_v1_install.rsp.xml.j2 + # TODO: More passwords required? + # See https://github.com/Azure/sap-automation/blob/experimental/deploy/ansible/ + # roles-db/4.0.0-hdb-install/templates/HANA_2_00_055_v1_install.rsp.xml.j2 - name: Run actual SAP HANA update block: @@ -75,6 +75,6 @@ when: hana_update_cleanup become: true become_user: root -# TODO remove + # TODO remove - name: Rescue SAP HANA update if it fails ansible.builtin.include_tasks: hdb_update_rescue.yml diff --git a/roles/hana_update/tasks/hdb_version.yml b/roles/hana_update/tasks/hdb_version.yml index f76e7f4..6075942 100644 --- a/roles/hana_update/tasks/hdb_version.yml +++ b/roles/hana_update/tasks/hdb_version.yml @@ -65,14 +65,14 @@ - name: Get version data (medium) vars: # index: "{{ item | regex_replace('^(.+?)\\|(.+?)\\|(.+?)\\|(.+?)\\|(.+?)$', '\\1') | trim }}" - name: "{{ item | regex_replace('^(.+?)\\|(.+?)\\|(.+?)\\|(.+?)\\|(.+?)$', '\\2') | trim }}" + version_name: "{{ item | regex_replace('^(.+?)\\|(.+?)\\|(.+?)\\|(.+?)\\|(.+?)$', '\\2') | trim }}" version: "{{ item | regex_replace('^(.+?)\\|(.+?)\\|(.+?)\\|(.+?)\\|(.+?)$', '\\3') | trim }}" batch_key: "{{ item | regex_replace('^(.+?)\\|(.+?)\\|(.+?)\\|(.+?)\\|(.+?)$', '\\4') | trim }}" location: "{{ item | regex_replace('^(.+?)\\|(.+?)\\|(.+?)\\|(.+?)\\|(.+?)$', '\\5') | trim }}" ansible.builtin.set_fact: > hana_update_hdb_version_medium_list: "{{ hana_update_hdb_version_medium_list | default([]) + [{ - 'name': name, + 'name': version_name, 'version': version, 'batch_key': batch_key, 'location': location diff --git a/roles/hana_update/tasks/requirements_validate.yml b/roles/hana_update/tasks/requirements_validate.yml index 956e99c..afabb1b 100644 --- a/roles/hana_update/tasks/requirements_validate.yml +++ b/roles/hana_update/tasks/requirements_validate.yml @@ -1,3 +1,4 @@ +--- # # Copyright 2023 Red Hat, Project Atmosphere # diff --git a/roles/sap_kernel_update/meta/argument_specs.yml b/roles/sap_kernel_update/meta/argument_specs.yml index 4b72a2c..04e6922 100644 --- a/roles/sap_kernel_update/meta/argument_specs.yml +++ b/roles/sap_kernel_update/meta/argument_specs.yml @@ -1,3 +1,17 @@ +--- +# +# Copyright 2023 Red Hat, Project Atmosphere +# +# This program is free software: you can redistribute it and/or modify it under the terms of the GNU +# General Public License as published by the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with this program. +# If not, see . + argument_specs: main: short_description: | diff --git a/roles/sap_kernel_update/tasks/init.yml b/roles/sap_kernel_update/tasks/init.yml index 0e3728d..c22e166 100644 --- a/roles/sap_kernel_update/tasks/init.yml +++ b/roles/sap_kernel_update/tasks/init.yml @@ -3,7 +3,7 @@ sap.sap_operations.parameter_info: name: "DIR_CT_RUN" instance_number: "{{ sap_kernel_update_instance }}" - register: __sap_kernel_update_sapexedb_sar_file + register: __sap_kernel_update_sapexedb_sar_file # noqa: var-naming[no-role-prefix] - name: Set kernel path ansible.builtin.set_fact: diff --git a/roles/sap_kernel_update/tasks/main.yml b/roles/sap_kernel_update/tasks/main.yml index 307dba3..ecfe5cf 100644 --- a/roles/sap_kernel_update/tasks/main.yml +++ b/roles/sap_kernel_update/tasks/main.yml @@ -7,7 +7,7 @@ sap.sap_operations.system_info: instance_number: "{{ sap_kernel_update_instance }}" feature: "ABAP" - register: __sap_kernel_update_apab_systems + register: __sap_kernel_update_apab_systems # noqa: var-naming[no-role-prefix] - name: Run rolling kernel upgrade in case there is multiple ABAP instances ansible.builtin.include_tasks: rolling_kernel_upgrade.yml diff --git a/roles/sap_kernel_update/tasks/normal_kernel_upgrade.yml b/roles/sap_kernel_update/tasks/normal_kernel_upgrade.yml index efec63f..626145c 100644 --- a/roles/sap_kernel_update/tasks/normal_kernel_upgrade.yml +++ b/roles/sap_kernel_update/tasks/normal_kernel_upgrade.yml @@ -1,3 +1,17 @@ +--- +# +# Copyright 2023 Red Hat, Project Atmosphere +# +# This program is free software: you can redistribute it and/or modify it under the terms of the GNU +# General Public License as published by the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with this program. +# If not, see . + - name: Stop SAP system sap.sap_operations.system: state: stopped @@ -19,9 +33,9 @@ dest: "{{ sap_kernel_update_kernel_path }}" remote_src: true mode: preserve - register: sap_kernel_updated_result + register: sap_kernel_updated_result # noqa: var-naming[no-role-prefix] -- name: Run saproot.sh fixup script +- name: Run saproot.sh fixup script # noqa: no-handler ansible.builtin.command: cmd: ./saproot.sh {{ sap_kernel_update_sid }} chdir: "{{ sap_kernel_update_kernel_path }}" diff --git a/roles/sap_kernel_update/tasks/rolling_kernel_upgrade.yml b/roles/sap_kernel_update/tasks/rolling_kernel_upgrade.yml index b782619..6597c05 100644 --- a/roles/sap_kernel_update/tasks/rolling_kernel_upgrade.yml +++ b/roles/sap_kernel_update/tasks/rolling_kernel_upgrade.yml @@ -1,3 +1,17 @@ +--- +# +# Copyright 2023 Red Hat, Project Atmosphere +# +# This program is free software: you can redistribute it and/or modify it under the terms of the GNU +# General Public License as published by the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with this program. +# If not, see . + # Seems ansible.builtin.copy backup works with files, but not with directories. # Create backup manually. - name: Backup previous SAP kernel @@ -14,9 +28,9 @@ dest: "{{ sap_kernel_update_kernel_path }}" remote_src: true mode: preserve - register: sap_kernel_updated_result + register: sap_kernel_updated_result # noqa: var-naming[no-role-prefix] -- name: Run saproot.sh fixup script +- name: Run saproot.sh fixup script # noqa: no-handler ansible.builtin.command: cmd: ./saproot.sh {{ sap_kernel_update_sid }} chdir: "{{ sap_kernel_update_kernel_path }}" diff --git a/roles/unpack/meta/main.yml b/roles/unpack/meta/main.yml index e77ad1f..dd0d100 100644 --- a/roles/unpack/meta/main.yml +++ b/roles/unpack/meta/main.yml @@ -34,7 +34,3 @@ galaxy_info: galaxy_tags: [] dependencies: [] - # - role: sap.sap_operations.application - # vars: - # sap_operations_application: sapcar - # sap_operations_state: present diff --git a/roles/unpack/tasks/prerequisites.yml b/roles/unpack/tasks/prerequisites.yml index f68e718..812f786 100644 --- a/roles/unpack/tasks/prerequisites.yml +++ b/roles/unpack/tasks/prerequisites.yml @@ -16,10 +16,10 @@ # # yamllint disable rule:command-instead-of-module -- name: Make sure unzip is installed +- name: Make sure unzip is installed # noqa: command-instead-of-module ansible.builtin.command: cmd: unzip - register: _ + register: _ # noqa: var-naming[no-role-prefix] failed_when: _.rc > 0 changed_when: false # yamllint enable rule:command-instead-of-module @@ -27,6 +27,6 @@ - name: Make sure sapcar is installed ansible.builtin.command: cmd: "{{ unpack_sapcar_exe_path }}" - register: _ + register: _ # noqa: var-naming[no-role-prefix] failed_when: _.rc > 0 changed_when: false