From 65a40afae7895418f1555cac5d3f0b6c771219c3 Mon Sep 17 00:00:00 2001 From: Kirill Satarin <22549266+kksat@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:26:21 +0200 Subject: [PATCH] Revert "Release galaxy-2.3.0" This reverts commit 0e1e86e5236a721c1f0a7e3e200508145496e2c5. --- docs/CHANGELOG.md | 326 ++++++++---------- galaxy.yml | 5 +- plugins/test/app_instance.yml | 55 --- plugins/test/ascs_instance.yml | 55 --- plugins/test/hana_instance.yml | 55 --- plugins/test/sap_instances.py | 55 --- roles/ssh_keys_distribute/README.md | 127 ------- roles/ssh_keys_distribute/defaults/main.yml | 26 -- .../meta/argument_specs.yml | 97 ------ roles/ssh_keys_distribute/meta/main.yml | 34 -- roles/ssh_keys_distribute/tasks/absent.yml | 40 --- roles/ssh_keys_distribute/tasks/main.yml | 25 -- roles/ssh_keys_distribute/tasks/present.yml | 55 --- 13 files changed, 146 insertions(+), 809 deletions(-) delete mode 100644 plugins/test/app_instance.yml delete mode 100644 plugins/test/ascs_instance.yml delete mode 100644 plugins/test/hana_instance.yml delete mode 100644 plugins/test/sap_instances.py delete mode 100644 roles/ssh_keys_distribute/README.md delete mode 100644 roles/ssh_keys_distribute/defaults/main.yml delete mode 100644 roles/ssh_keys_distribute/meta/argument_specs.yml delete mode 100644 roles/ssh_keys_distribute/meta/main.yml delete mode 100644 roles/ssh_keys_distribute/tasks/absent.yml delete mode 100644 roles/ssh_keys_distribute/tasks/main.yml delete mode 100644 roles/ssh_keys_distribute/tasks/present.yml diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7e5a473..6c133ec 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,209 +2,171 @@ **Topics** -- v2\.3\.0 +- v2\.1\.0 - Release Summary - - New Plugins - - Test -- v2\.2\.0 - - Release Summary - Major Changes -- v2\.1\.0 - - Release Summary - - Major Changes - Minor Changes - v2\.0\.1 - - Release Summary + - Release Summary - Minor Changes - v2\.0\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.36\.1 - - Release Summary + - Release Summary - Minor Changes - v1\.36\.0 + - Release Summary + - Major Changes +- v1\.35\.0 + - Release Summary +- v1\.34\.0 - Release Summary - Major Changes -- v1\.35\.0 +- v1\.33\.1 - Release Summary -- v1\.34\.0 + - Minor Changes +- v1\.33\.0 - Release Summary - Major Changes -- v1\.33\.1 +- v1\.32\.0 - Release Summary - - Minor Changes -- v1\.33\.0 - - Release Summary - Major Changes -- v1\.32\.0 - - Release Summary - - Major Changes - v1\.31\.1 - - Release Summary + - Release Summary - Minor Changes - v1\.31\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.30\.3 - - Release Summary + - Release Summary - Minor Changes - v1\.30\.2 - - Release Summary + - Release Summary - Minor Changes - v1\.30\.1 - - Release Summary + - Release Summary - Minor Changes - v1\.30\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - Minor Changes - v1\.29\.0 - - Release Summary + - Release Summary - v1\.28\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - Minor Changes - v1\.27\.0 - - Release Summary + - Release Summary - Minor Changes - v1\.26\.0 - - Release Summary + - Release Summary - v1\.25\.0 - - Release Summary + - Release Summary - v1\.24\.0 - - Release Summary + - Release Summary - v1\.23\.1 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.23\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.22\.1 - - Release Summary + - Release Summary - Minor Changes - v1\.22\.0 - - Release Summary + - Release Summary - v1\.21\.0 - v1\.20\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.19\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.18\.0 - v1\.17\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.16\.0 - v1\.15\.1 - - Release Summary + - Release Summary - Minor Changes - v1\.15\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.14\.1 - - Release Summary + - Release Summary - Minor Changes - v1\.14\.0 - v1\.13\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.12\.0 - - Release Summary + - Release Summary - v1\.11\.0 - - Release Summary + - Release Summary - Minor Changes - v1\.10\.0 - - Release Summary + - Release Summary - v1\.9\.1 - - Release Summary + - Release Summary - Minor Changes - v1\.9\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.3\.2 - - Release Summary + - Release Summary - Minor Changes - v1\.3\.1 - - Release Summary + - Release Summary - Minor Changes - v1\.3\.0 - - Release Summary + - Release Summary - Minor Changes - v1\.2\.2 - - Release Summary + - Release Summary - Minor Changes - v1\.2\.1 - - Release Summary + - Release Summary - Minor Changes - v1\.2\.0 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.1\.2 - - Release Summary + - Release Summary - Minor Changes - v1\.1\.1 - - Release Summary + - Release Summary - Minor Changes - v1\.1\.0 - - Release Summary + - Release Summary - v1\.0\.5 - - Release Summary + - Release Summary - Minor Changes - v1\.0\.4 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - Minor Changes - v1\.0\.3 - - Release Summary + - Release Summary - Minor Changes - v1\.0\.2 - - Release Summary - - Major Changes + - Release Summary + - Major Changes - v1\.0\.0 - - Release Summary - - Major Changes - - -## v2\.3\.0 - - -### Release Summary - -Feature release - - -### New Plugins - - -#### Test - -* sap\.sap\_operations\.app\_instance \- Test to check if the provided sap instance is SAP application instance\. -* sap\.sap\_operations\.ascs\_instance \- Test to check if the provided sap instance is SAP ASCS instance\. -* sap\.sap\_operations\.hana\_instance \- Test to check if the provided sap instance is SAP HANA instance\. - - -## v2\.2\.0 - - -### Release Summary - -Feature release - - -### Major Changes - -* add role ssh\_keys\_distribute + - Release Summary + - Major Changes ## v2\.1\.0 - + ### Release Summary Feature release - + ### Major Changes * add sample\_hana\_present\_e2e playbook to demonstrate how collection content can be used to manage SAP HANA @@ -228,7 +190,7 @@ Feature release ## v2\.0\.1 - + ### Release Summary Minor corrections @@ -241,12 +203,12 @@ Minor corrections ## v2\.0\.0 - + ### Release Summary Lifecycle release - + ### Major Changes * clarify what RHEL for SAP versions are supported @@ -255,7 +217,7 @@ Lifecycle release ## v1\.36\.1 - + ### Release Summary Bugfix release @@ -270,12 +232,12 @@ Bugfix release ## v1\.36\.0 - + ### Release Summary Feature release - + ### Major Changes * add role swmp \- to manage SAP SWPM \(download\, install\, uninstall\) @@ -283,7 +245,7 @@ Feature release ## v1\.35\.0 - + ### Release Summary Feature release @@ -291,12 +253,12 @@ Feature release ## v1\.34\.0 - + ### Release Summary Feature release - + ### Major Changes * add role hana\_preconfigure @@ -304,7 +266,7 @@ Feature release ## v1\.33\.1 - + ### Release Summary Documentation fix release @@ -317,12 +279,12 @@ Documentation fix release ## v1\.33\.0 - + ### Release Summary Feature release - + ### Major Changes * add filter plugin \- me\_aliases @@ -333,12 +295,12 @@ Feature release ## v1\.32\.0 - + ### Release Summary Feature release - + ### Major Changes * add role general\_preconfigure @@ -346,7 +308,7 @@ Feature release ## v1\.31\.1 - + ### Release Summary Feature release @@ -359,12 +321,12 @@ Feature release ## v1\.31\.0 - + ### Release Summary Feature release - + ### Major Changes * add \'commands\' show\_c and show\_w as mandated by GPL\-3\.0 license @@ -372,7 +334,7 @@ Feature release ## v1\.30\.3 - + ### Release Summary Bugfix release @@ -386,7 +348,7 @@ Bugfix release ## v1\.30\.2 - + ### Release Summary Lifecycle release @@ -399,7 +361,7 @@ Lifecycle release ## v1\.30\.1 - + ### Release Summary Bugfix release @@ -414,12 +376,12 @@ Bugfix release ## v1\.30\.0 - + ### Release Summary Feature release - + ### Major Changes * role \- download \- download SAP software from SWDC @@ -433,7 +395,7 @@ Feature release ## v1\.29\.0 - + ### Release Summary Feature release @@ -441,12 +403,12 @@ Feature release ## v1\.28\.0 - + ### Release Summary Feature and bugfix release - + ### Major Changes * add role powershell \- to manage powershell installation @@ -462,7 +424,7 @@ Feature and bugfix release ## v1\.27\.0 - + ### Release Summary Feature release @@ -476,7 +438,7 @@ Feature release ## v1\.26\.0 - + ### Release Summary Feature release @@ -484,7 +446,7 @@ Feature release ## v1\.25\.0 - + ### Release Summary Feature release @@ -492,7 +454,7 @@ Feature release ## v1\.24\.0 - + ### Release Summary Feature release @@ -500,12 +462,12 @@ Feature release ## v1\.23\.1 - + ### Release Summary Documentation release - + ### Major Changes * Added documentation website docs\.galaxy\.saponrhel\.org @@ -513,12 +475,12 @@ Documentation release ## v1\.23\.0 - + ### Release Summary Maintenance release - + ### Major Changes * minimal ansible version supported is 2\.15 @@ -526,7 +488,7 @@ Maintenance release ## v1\.22\.1 - + ### Release Summary Documentation release @@ -540,7 +502,7 @@ Documentation release ## v1\.22\.0 - + ### Release Summary Feature release @@ -551,12 +513,12 @@ Feature release ## v1\.20\.0 - + ### Release Summary Feature release - + ### Major Changes * Add role cf \- to manage Cloud Foundry cli @@ -564,12 +526,12 @@ Feature release ## v1\.19\.0 - + ### Release Summary Feature release - + ### Major Changes * Add role cloudconnector @@ -580,12 +542,12 @@ Feature release ## v1\.17\.0 - + ### Release Summary Feature release - + ### Major Changes * Add role sapjvm @@ -596,7 +558,7 @@ Feature release ## v1\.15\.1 - + ### Release Summary Bugfix release @@ -609,12 +571,12 @@ Bugfix release ## v1\.15\.0 - + ### Release Summary Feature release - + ### Major Changes * Add role hana @@ -622,7 +584,7 @@ Feature release ## v1\.14\.1 - + ### Release Summary Bug fix release @@ -639,12 +601,12 @@ Bug fix release ## v1\.13\.0 - + ### Release Summary Feature release - + ### Major Changes * Add ABAP transport management modules @@ -652,7 +614,7 @@ Feature release ## v1\.12\.0 - + ### Release Summary Feature release @@ -660,7 +622,7 @@ Feature release ## v1\.11\.0 - + ### Release Summary Feature release @@ -673,7 +635,7 @@ Feature release ## v1\.10\.0 - + ### Release Summary Feature release @@ -681,7 +643,7 @@ Feature release ## v1\.9\.1 - + ### Release Summary Bug fix release @@ -695,12 +657,12 @@ Bug fix release ## v1\.9\.0 - + ### Release Summary Lifecycle release - + ### Major Changes * Add \'all\' and \'any\' filter and test plugins @@ -713,7 +675,7 @@ Lifecycle release ## v1\.3\.2 - + ### Release Summary Bugfix release @@ -726,7 +688,7 @@ Bugfix release ## v1\.3\.1 - + ### Release Summary Bugfix release @@ -739,7 +701,7 @@ Bugfix release ## v1\.3\.0 - + ### Release Summary Feature release @@ -754,7 +716,7 @@ Feature release ## v1\.2\.2 - + ### Release Summary Feature release @@ -767,7 +729,7 @@ Feature release ## v1\.2\.1 - + ### Release Summary Feature release @@ -780,12 +742,12 @@ Feature release ## v1\.2\.0 - + ### Release Summary Feature release - + ### Major Changes * Introduction of NW RFC modules to connect to manage SAP ABAP system with Ansible @@ -793,7 +755,7 @@ Feature release ## v1\.1\.2 - + ### Release Summary Bug Fix Release @@ -806,7 +768,7 @@ Bug Fix Release ## v1\.1\.1 - + ### Release Summary Bug Fix Release @@ -822,7 +784,7 @@ Bug Fix Release ## v1\.1\.0 - + ### Release Summary Feature Release @@ -830,7 +792,7 @@ Feature Release ## v1\.0\.5 - + ### Release Summary Bug fix release @@ -843,12 +805,12 @@ Bug fix release ## v1\.0\.4 - + ### Release Summary Two roles are added hana\_update and prepare - + ### Major Changes * Role hana\_update \- update SAP HANA system @@ -862,7 +824,7 @@ Two roles are added hana\_update and ## v1\.0\.3 - + ### Release Summary Using changelog fragments to build collection changelog\. @@ -876,12 +838,12 @@ Using changelog fragments to build collection changelog\. ## v1\.0\.2 - + ### Release Summary First release of SAP Operations collection\. - + ### Major Changes * parameter\_info \- module to fetch parameter information\. @@ -893,12 +855,12 @@ First release of SAP Operations collection\. ## v1\.0\.0 - + ### Release Summary First release of SAP Operations collection\. - + ### Major Changes * parameter\_info \- module to fetch parameter information\. diff --git a/galaxy.yml b/galaxy.yml index 675eec4..9eead16 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -24,7 +24,7 @@ namespace: sap name: sap_operations -version: 2.3.0 +version: 2.1.0 readme: README.md @@ -53,8 +53,7 @@ tags: - cloud - pacemaker -dependencies: - "community.crypto": ">=2.22.2" +dependencies: {} repository: https://github.com/redhat-sap/rh_operations diff --git a/plugins/test/app_instance.yml b/plugins/test/app_instance.yml deleted file mode 100644 index 67b5b07..0000000 --- a/plugins/test/app_instance.yml +++ /dev/null @@ -1,55 +0,0 @@ -# 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 . - ---- -DOCUMENTATION: - name: app_instance - author: Kirill Satarin (@kksat) - extends_documentation_fragment: sap.sap_operations.community - version_added: 2.3.0 - short_description: Test to check if the provided sap instance is SAP application instance. - description: - - Test to check if the provided sap instance is SAP application instance. - - This test filter is expected to be used with combination of sap.sap_operations.host_info module - - Type of instance is determined by processes this instance runs (ProcessList value) - options: - value: - description: One of the instances, returned by sap.sap_operations.host_info - required: true - seealso: - - module: sap.sap_operations.host_info - -EXAMPLES: | - - name: Get all sap instances - sap.sap_operations.host_info: - become: true - become_user: root - register: host_info - - - name: Filter only SAP APP instances - ansible.builtin.debug: - msg: "{{ host_info.instances | select('sap.sap_operations.app_instance') }}" - -RETURN: - _value: - type: boolean - description: True if instance is SAP APP instance - example: true diff --git a/plugins/test/ascs_instance.yml b/plugins/test/ascs_instance.yml deleted file mode 100644 index b33358b..0000000 --- a/plugins/test/ascs_instance.yml +++ /dev/null @@ -1,55 +0,0 @@ -# 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 . - ---- -DOCUMENTATION: - name: ascs_instance - author: Kirill Satarin (@kksat) - extends_documentation_fragment: sap.sap_operations.community - version_added: 2.3.0 - short_description: Test to check if the provided sap instance is SAP ASCS instance. - description: - - Test to check if the provided sap instance is SAP ASCS instance. - - This test filter is expected to be used with combination of sap.sap_operations.host_info module - - Type of instance is determined by processes this instance runs (ProcessList value) - options: - value: - description: One of the instances, returned by sap.sap_operations.host_info - required: true - seealso: - - module: sap.sap_operations.host_info - -EXAMPLES: | - - name: Get all sap instances - sap.sap_operations.host_info: - become: true - become_user: root - register: host_info - - - name: Filter only SAP ASCS instances - ansible.builtin.debug: - msg: "{{ host_info.instances | select('sap.sap_operations.ascs_instance') }}" - -RETURN: - _value: - type: boolean - description: True if instance is SAP ASCS instance - example: true diff --git a/plugins/test/hana_instance.yml b/plugins/test/hana_instance.yml deleted file mode 100644 index a120ebf..0000000 --- a/plugins/test/hana_instance.yml +++ /dev/null @@ -1,55 +0,0 @@ -# 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 . - ---- -DOCUMENTATION: - name: hana_instance - author: Kirill Satarin (@kksat) - extends_documentation_fragment: sap.sap_operations.community - version_added: 2.3.0 - short_description: Test to check if the provided sap instance is SAP HANA instance. - description: - - Test to check if the provided sap instance is SAP HANA instance. - - This test filter is expected to be used with combination of sap.sap_operations.host_info module - - Type of instance is determined by processes this instance runs (ProcessList value) - options: - value: - description: One of the instances, returned by sap.sap_operations.host_info - required: true - seealso: - - module: sap.sap_operations.host_info - -EXAMPLES: | - - name: Get all sap instances - sap.sap_operations.host_info: - become: true - become_user: root - register: host_info - - - name: Filter only SAP HANA instances - ansible.builtin.debug: - msg: "{{ host_info.instances | select('sap.sap_operations.hana_instance') }}" - -RETURN: - _value: - type: boolean - description: True if instance is SAP HANA instance - example: true diff --git a/plugins/test/sap_instances.py b/plugins/test/sap_instances.py deleted file mode 100644 index 2d54b34..0000000 --- a/plugins/test/sap_instances.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- - -# 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 . - -from __future__ import absolute_import, division, print_function - -__metaclass__ = type - - -def sap_instance(name: str, description: str): - def f(instance): - try: - return any( - instance_process["name"] == name - and instance_process["description"] == description - for instance_process in instance["ProcessList"] - ) - except KeyError: - return False - - return f - - -def ascs_instance(instance): - return sap_instance(name="enserver", description="EnqueueServer")( - instance - ) and sap_instance(name="msg_server", description="MessageServer")(instance) - - -class TestModule(object): - def tests(self): - return { - "hana_instance": sap_instance(name="hdbdaemon", description="HDB Daemon"), - "app_instance": sap_instance(name="disp+work", description="Dispatcher"), - "ascs_instance": ascs_instance, - } diff --git a/roles/ssh_keys_distribute/README.md b/roles/ssh_keys_distribute/README.md deleted file mode 100644 index aa519b0..0000000 --- a/roles/ssh_keys_distribute/README.md +++ /dev/null @@ -1,127 +0,0 @@ - - -# ssh_keys_distribute - -Generate and distribute ssh keys for host to host communication - - -Generate and distribute ssh keys for host to host communication -Role has two modes of operation - present and absent, see variable ssh_keys_distribute_state -If state=present role will ensure that ssh key (see below about key name) -is present, key will be generated if absent, key will never be regenerated. -After that role will distribute this key to other hosts, see how list of hosts defined below. - -If state=absent, role will make sure that key authorization on all hosts is removed. -ssh key, even if it was generated will not be removed by the role. - - - - -## Role Variables - -### Required parameters: - - - -#### ssh_keys_distribute_state - - -_Type:_ `str` - -_Default:_ `present` - -_Required:_ `False` -_Choices:_ -- present -- absent -_Description:_ -State=present - role will ensure that ssh keys are present (generated) -State=absent - role will ensure that ssh key with name defined in variable ssh_keys_distribute_key -cannot be used to login to hosts (using user defined in ssh_keys_distribute_user) - - - - -#### ssh_keys_distribute_user - - -_Type:_ `str` - -_Default:_ `root` - -_Required:_ `False` -_Description:_ -User for which key if be generated (if required) and distributed to all the hosts -ansible_user should be able to sudo to this user - - - - -#### ssh_keys_distribute_key - - -_Type:_ `str` - -_Default:_ `id_rsa` - -_Required:_ `False` -_Description:_ -Name of the key to distribute, should not contain '*.pub' - - - -#### ssh_keys_distribute_hosts - - -_Type:_ `list` - - -_Required:_ `False` -_Description:_ -Lists of hosts, where key will be distributed, default value is ansible magic variable ansible_play_hosts - - - - -## Limitations - - - -## Dependencies - -Role depend on collection community.crypto - -## Example Playbooks - - - name: Run role ssh_keys_distribute - ansible.builtin.include_role: - name: sap.sap_operations.ssh_keys_distribute - -## License - -GPL-3.0-only - -## Author Information - -Kirill Satarin (@kksat) diff --git a/roles/ssh_keys_distribute/defaults/main.yml b/roles/ssh_keys_distribute/defaults/main.yml deleted file mode 100644 index 6e23a0f..0000000 --- a/roles/ssh_keys_distribute/defaults/main.yml +++ /dev/null @@ -1,26 +0,0 @@ -# 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 . - ---- -ssh_keys_distribute_state: present -ssh_keys_distribute_user: root -ssh_keys_distribute_key: id_rsa -ssh_keys_distribute_hosts: "{{ ansible_play_hosts }}" diff --git a/roles/ssh_keys_distribute/meta/argument_specs.yml b/roles/ssh_keys_distribute/meta/argument_specs.yml deleted file mode 100644 index 8e4a053..0000000 --- a/roles/ssh_keys_distribute/meta/argument_specs.yml +++ /dev/null @@ -1,97 +0,0 @@ ---- -# 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 . - -argument_specs: - main: - short_description: Generate and distribute ssh keys for host to host communication - description: - - Generate and distribute ssh keys for host to host communication - - Role has two modes of operation - present and absent, see variable ssh_keys_distribute_state - - | - If state=present role will ensure that ssh key (see below about key name) - is present, key will be generated if absent, key will never be regenerated. - After that role will distribute this key to other hosts, see how list of hosts defined below. - - | - If state=absent, role will make sure that key authorization on all hosts is removed. - ssh key, even if it was generated will not be removed by the role. - - options: - ssh_keys_distribute_state: - description: | - State=present - role will ensure that ssh keys are present (generated) - State=absent - role will ensure that ssh key with name defined in variable ssh_keys_distribute_key - cannot be used to login to hosts (using user defined in ssh_keys_distribute_user) - type: str - choices: - - present - - absent - required: false - default: present - ssh_keys_distribute_user: - description: | - User for which key if be generated (if required) and distributed to all the hosts - ansible_user should be able to sudo to this user - type: str - required: false - default: root - ssh_keys_distribute_key: - description: Name of the key to distribute, should not contain '*.pub' - type: str - required: false - default: id_rsa - ssh_keys_distribute_hosts: - description: Lists of hosts, where key will be distributed, default value is ansible magic variable ansible_play_hosts - type: list - elements: str - required: false - - __limitations__: - options: {} - short_description: Limitations - description: - - "" - - __dependencies__: - options: {} - short_description: Dependencies - description: - - Role depend on collection community.crypto - - __examples__: - options: {} - short_description: Example Playbooks - description: - - " - name: Run role ssh_keys_distribute" - - " ansible.builtin.include_role:" - - " name: sap.sap_operations.ssh_keys_distribute" - - __license__: - options: {} - short_description: License - description: - - GPL-3.0-only - - __author__: - options: {} - short_description: Author Information - description: - - Kirill Satarin (@kksat) diff --git a/roles/ssh_keys_distribute/meta/main.yml b/roles/ssh_keys_distribute/meta/main.yml deleted file mode 100644 index fbed444..0000000 --- a/roles/ssh_keys_distribute/meta/main.yml +++ /dev/null @@ -1,34 +0,0 @@ -# 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 . - ---- -galaxy_info: - author: Kirill Satarin - description: Generate and distribute ssh keys for host to host communication - license: GPL-3.0-only - min_ansible_version: "2.15" - platforms: - - name: EL - versions: - - "8" - - "9" - galaxy_tags: [] -dependencies: [] diff --git a/roles/ssh_keys_distribute/tasks/absent.yml b/roles/ssh_keys_distribute/tasks/absent.yml deleted file mode 100644 index 0ca0b9f..0000000 --- a/roles/ssh_keys_distribute/tasks/absent.yml +++ /dev/null @@ -1,40 +0,0 @@ -# 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 . - ---- -- name: Slurp ssh public key - ansible.builtin.slurp: - src: "~/.ssh/{{ ssh_keys_distribute_key }}.pub" - become: true - become_user: "{{ ssh_keys_distribute_user }}" - register: ssh_keys_distribute_slurp - -- name: Remove ssh key authorization on all hosts - ansible.posix.authorized_key: - user: "{{ ssh_keys_distribute_user }}" - state: absent - key: "{{ ssh_keys_distribute_slurp.content | b64decode }}" - become: true - become_user: "{{ ssh_keys_distribute_user }}" - delegate_to: "{{ host_item }}" - loop: "{{ ssh_keys_distribute_hosts }}" - loop_control: - loop_var: host_item diff --git a/roles/ssh_keys_distribute/tasks/main.yml b/roles/ssh_keys_distribute/tasks/main.yml deleted file mode 100644 index bdd6e37..0000000 --- a/roles/ssh_keys_distribute/tasks/main.yml +++ /dev/null @@ -1,25 +0,0 @@ -# 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 . - ---- -- name: Include tasks depending on state - ansible.builtin.include_tasks: - file: "{{ ssh_keys_distribute_state }}.yml" diff --git a/roles/ssh_keys_distribute/tasks/present.yml b/roles/ssh_keys_distribute/tasks/present.yml deleted file mode 100644 index 3422aeb..0000000 --- a/roles/ssh_keys_distribute/tasks/present.yml +++ /dev/null @@ -1,55 +0,0 @@ -# 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 . - ---- -- name: Create ~/.ssh directory if it does not exist - ansible.builtin.file: - path: ~/.ssh - state: directory - mode: '0700' - become: true - become_user: "{{ ssh_keys_distribute_user }}" - -- name: Generate an OpenSSH keypair - community.crypto.openssh_keypair: - path: "~/.ssh/{{ ssh_keys_distribute_key }}" - regenerate: never - become: true - become_user: "{{ ssh_keys_distribute_user }}" - -- name: Slurp ssh public key - ansible.builtin.slurp: - src: "~/.ssh/{{ ssh_keys_distribute_key }}.pub" - become: true - become_user: "{{ ssh_keys_distribute_user }}" - register: ssh_keys_distribute_slurp - -- name: Authorize ssh key on all hosts - ansible.posix.authorized_key: - user: "{{ ssh_keys_distribute_user }}" - state: present - key: "{{ ssh_keys_distribute_slurp.content | b64decode }}" - become: true - become_user: "{{ ssh_keys_distribute_user }}" - delegate_to: "{{ host_item }}" - loop: "{{ ssh_keys_distribute_hosts }}" - loop_control: - loop_var: host_item