Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release galaxy-1.36.0 #83

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
268 changes: 142 additions & 126 deletions docs/CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace: sap

name: sap_operations

version: 1.35.0
version: 1.36.0

readme: README.md

Expand Down
13 changes: 8 additions & 5 deletions plugins/modules/me_downloaditemset_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,22 +663,25 @@ def main():

url = me_download_item_set_url(
ENR=enr,
PECGRSC1=PECGRSC1_from_architecture_and_os_family[architecture][
os_family
], # noqa: E501
PECGRSC1=PECGRSC1_from_architecture_and_os_family[architecture][os_family],
)

response = module(url=url)

if response.get("d") is None or response.get("d").get("results") is None:
module.fail_json(
msg="Failed to fetch information from SAP software download center", # noqa: E501
msg="Failed to fetch information from SAP software download center",
response=response,
)

me_downloaditemset_info = response["d"]["results"]
for itemset in me_downloaditemset_info:
if ("FileSize" not in itemset) and ("Filesize" in itemset):
itemset["FileSize"] = itemset["Filesize"]

module.exit_json(
changed=False,
me_downloaditemset_info=response["d"]["results"],
me_downloaditemset_info=me_downloaditemset_info,
)


Expand Down
18 changes: 4 additions & 14 deletions roles/download/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
when:
- ansible_facts['mounts'] is defined
- ansible_facts['mounts'] | length > 0
- __mount_point['size_available'] // 1024 <= __size_needed
- (__mount_point['size_available'] // 1024) | int <= __size_needed | int
vars:
__mount_point: "{{ ansible_facts['mounts'] |
sap.sap_operations.mount_path(filepath=download_destination) }}"
Expand Down Expand Up @@ -89,28 +89,18 @@
default(item.item.DownloadDirectLink)
}}"
download_file_filename: "{{ item.me_file_info.FileName }}"
download_file_filepath: "{{ download_destination }}/{{ item_filename }}"
download_file_filepath: "{{ (download_destination, item_filename) | ansible.builtin.path_join }}"
download_file_existing_file_checksum: >-
{{ download_destination_stats.results
| selectattr('stat', 'defined')
| map(attribute='stat')
| selectattr('path', 'equalto', present_file_fullpath)
| selectattr('path', 'equalto', download_file_filepath)
| map(attribute='checksum')
| first
| default("")
}}
download_file_existing_file_filepath: "{{ download_destination }}/{{ item_filename }}"
download_file_existing_file_filepath: "{{ (download_destination, item_filename) | ansible.builtin.path_join }}"
item_filename: "{{ item.me_file_info.FileName }}"
present_file_fullpath: "{{ download_destination }}/{{ item_filename }}"
present_file_checksum: >-
{{ download_destination_stats.results
| selectattr('stat', 'defined')
| map(attribute='stat')
| selectattr('path', 'equalto', present_file_fullpath)
| map(attribute='checksum')
| first
| default("")
}}
loop: "{{ download_files_info.results }}"
loop_control:
label: "{{ download_file_url }} - {{ item_filename }}"
2 changes: 2 additions & 0 deletions roles/sapcar/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ argument_specs:
description:
- Path to sapcar executable file
- Default value is from collection variable sap_operations_sapcar_exe_path
- All parent directories to directory where sapcar executable should be located should exists and be writable for ansible user
- Role will not create /usr/sap directory and will not set owner and mode for this
type: path
required: false
default: /usr/sap/sapcar/sapcar
Expand Down
165 changes: 165 additions & 0 deletions roles/swpm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<!--
SPDX-License-Identifier: GPL-3.0-only
SPDX-FileCopyrightText: 2023-2024 Red Hat, Project Atmosphere

Copyright 2023-2024 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.

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
-->

# swpm

Manage SAP SWPM (download / install / uninstall)


Manage SAP SWPM
Role will download SAP SWPM binary from SAP SWDC (software download center)
Role will use ansible_facts to determine current host os system and architecture to download correct binary
Role will download latest SP available from SAP SWDC web site in that sense role is not idempotent,
because next time one will run this role, there might be new SP of SAP SWPM

Role will not do anything if swpm_state='present' and file sapinst exists in swpm_unpack_destination



## Role Variables

### Required parameters:


- [swpm_download_username](#swpm_download_username)

- [swpm_download_password](#swpm_download_password)


#### swpm_download_username


_Type:_ `str`


_Required:_ `True`
_Description:_
Username (sap support user, suser) that will be used to download software.
By default value is from collection variable `sap_operations_download_username`.
Collection variable `sap_operations_download_username` default value is set to environment variable SAP_OPERATIONS_DOWNLOAD_USERNAME




#### swpm_download_password


_Type:_ `str`


_Required:_ `True`
_Description:_
Password of provided username that will be used to download software
By default value is from collection variable `sap_operations_download_password`.
Collection variable `sap_operations_download_password` default value is set to environment variable SAP_OPERATIONS_DOWNLOAD_PASSWORD




#### swpm_state


_Type:_ `str`

_Default:_ `present`

_Required:_ `False`
_Choices:_
- present
- downloaded
- absent
_Description:_
State for SAP SWPM
present - role will ensure that executable will downloaded and installed (copied to swpm_unpack_destination)
present - will do any changes only if file sapinst in swpm_unpack_destination does not exists
absent - role will ensure that SAP SWPM is absent, swpm_unpack_destination directory will be removed
downloaded - role will only download SAP SWPM binary archive



#### swpm_unpack_destination


_Type:_ `path`

_Default:_ `/usr/sap/swpm`

_Required:_ `False`
_Description:_
Path there SAP SWPM binary archive will be unpacked (in case of swpm_state='present')
Role will not create swpm_unpack_destination folder or any folders above it. It has to exists



#### swpm_download_destination


_Type:_ `path`

_Default:_ `/tmp/`

_Required:_ `False`
_Description:_
Path there SAP SWPM binary archive will be downloaded (in case of swpm_state='present' or swpm_state='downloaded')
Role will not create swpm_download_destination folder or any folders above it. It has to exists



#### swpm_version


_Type:_ `str`

_Default:_ `2.0`

_Required:_ `False`
_Choices:_
- 2.0
- 1.0
_Description:_
SAP SWPM version that will be downloaded and / or installed
Role will always download SP version that was changed last on SAP SWDC (software download center)




## Limitations

Tested only on RHEL 8 and 9
Tested only on x86_64 architecture

## Dependencies

Role has no dependencies to other roles.

## Example Playbooks



## License

GPL-3.0-only

## Author Information

Kirill Satarin (@kksat)
34 changes: 34 additions & 0 deletions roles/swpm/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# SPDX-License-Identifier: GPL-3.0-only
# SPDX-FileCopyrightText: 2024 Red Hat, Project Atmosphere
#
# Copyright 2024 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.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# You should have received a copy of the GNU General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.

---
sap_operations_download_username: "{{ lookup('ansible.builtin.env', 'SAP_OPERATIONS_DOWNLOAD_USERNAME') }}" # noqa var-naming[no-role-prefix]
sap_operations_download_password: "{{ lookup('ansible.builtin.env', 'SAP_OPERATIONS_DOWNLOAD_PASSWORD') }}" # noqa var-naming[no-role-prefix]

swpm_download_username: "{{ sap_operations_download_username }}"
swpm_download_password: "{{ sap_operations_download_password }}"

swpm_version: "2.0"
swpm_download_destination: /tmp/
swpm_state: present

sap_operations_swpm_unpack_destination: /usr/sap/swpm # noqa var-naming[no-role-prefix]
swpm_unpack_destination: "{{ sap_operations_swpm_unpack_destination }}"
Loading
Loading