-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: kksat <[email protected]>
- Loading branch information
Showing
27 changed files
with
2,087 additions
and
178 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ namespace: sap | |
|
||
name: sap_operations | ||
|
||
version: 2.8.0 | ||
version: 2.9.0 | ||
|
||
readme: README.md | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<!-- | ||
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/>. | ||
--> | ||
|
||
# hana_sudoers | ||
|
||
Manage SAP HANA sudoers records | ||
|
||
|
||
Manage SAP HANA sudoers records | ||
See https://access.redhat.com/articles/6093611 | ||
Role requires root access | ||
|
||
|
||
|
||
## Role Variables | ||
|
||
### Required parameters: | ||
|
||
|
||
|
||
#### hana_sudoers_sids | ||
|
||
|
||
_Type:_ `list` | ||
|
||
_Default:_ `[]` | ||
|
||
_Required:_ `False` | ||
_Description:_ | ||
SAP HANA sid (system id) to configure sudoers file | ||
Can be list of single value | ||
If not defined or is empty list, list of installed SAP HANA instances will be determined by the role | ||
|
||
|
||
|
||
#### hana_sudoers_state | ||
|
||
|
||
_Type:_ `str` | ||
|
||
_Default:_ `present` | ||
|
||
_Required:_ `False` | ||
_Choices:_ | ||
- present | ||
- absent | ||
_Description:_ | ||
Ensure records are present or absent in sudoers file | ||
|
||
|
||
|
||
#### hana_sudoers_data_centers | ||
|
||
|
||
_Type:_ `str` | ||
|
||
_Default:_ `['*']` | ||
|
||
_Required:_ `False` | ||
_Description:_ | ||
List of data centers to create records for. By default records will not be limited to datacenter (see default value) | ||
|
||
|
||
|
||
|
||
## Limitations | ||
|
||
Role was tested only on x86_64 architecture | ||
Role tested only for scaleup systems | ||
|
||
## Dependencies | ||
|
||
Role has no dependencies to other roles. | ||
|
||
## Example Playbooks | ||
|
||
|
||
|
||
## License | ||
|
||
GPL-3.0-only | ||
|
||
## Author Information | ||
|
||
Kirill Satarin (@kksat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# 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/>. | ||
|
||
--- | ||
hana_sudoers_state: present | ||
hana_sudoers_data_centers: ['*'] | ||
hana_sudoers_sids: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# 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/>. | ||
|
||
--- | ||
argument_specs: | ||
main: | ||
short_description: Manage SAP HANA sudoers records | ||
description: | ||
- Manage SAP HANA sudoers records | ||
- See https://access.redhat.com/articles/6093611 | ||
- Role requires root access | ||
options: | ||
hana_sudoers_sids: | ||
description: | ||
- SAP HANA sid (system id) to configure sudoers file | ||
- Can be list of single value | ||
- If not defined or is empty list, list of installed SAP HANA instances will be determined by the role | ||
type: list | ||
elements: str | ||
required: false | ||
default: [] | ||
|
||
hana_sudoers_state: | ||
description: Ensure records are present or absent in sudoers file | ||
type: str | ||
choices: | ||
- present | ||
- absent | ||
required: false | ||
default: present | ||
|
||
hana_sudoers_data_centers: | ||
description: List of data centers to create records for. By default records will not be limited to datacenter (see default value) | ||
type: str | ||
required: false | ||
default: "['*']" | ||
|
||
__limitations__: | ||
options: {} | ||
short_description: Limitations | ||
description: | ||
- Role was tested only on x86_64 architecture | ||
- Role tested only for scaleup systems | ||
|
||
__dependencies__: | ||
options: {} | ||
short_description: Dependencies | ||
description: | ||
- Role has no dependencies to other roles. | ||
|
||
__examples__: | ||
options: {} | ||
short_description: Example Playbooks | ||
description: | ||
- "" | ||
|
||
__license__: | ||
options: {} | ||
short_description: License | ||
description: | ||
- GPL-3.0-only | ||
|
||
__author__: | ||
options: {} | ||
short_description: Author Information | ||
description: | ||
- Kirill Satarin (@kksat) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/>. | ||
|
||
--- | ||
galaxy_info: | ||
author: Kirill Satarin (@kksat) | ||
description: Manage SAP HANA sudoers records | ||
license: GPL-3.0-only | ||
min_ansible_version: "2.15" | ||
platforms: | ||
- name: EL | ||
versions: | ||
- "8" | ||
- "9" | ||
galaxy_tags: [] | ||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# 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/>. | ||
|
||
--- | ||
- name: Get list of SAP instances | ||
sap.sap_operations.host_info: | ||
become: true | ||
become_user: root | ||
register: hana_sudoers_host_info | ||
when: (hana_sudoers_sids is undefined) or (hana_sudoers_sids == []) | ||
|
||
- name: Ensure sudoers file is configured for all SAP HANA sids | ||
ansible.builtin.include_tasks: sudoers.yml | ||
loop: "{{ hana_sudoers_sid_list | flatten }}" | ||
loop_control: | ||
loop_var: hana_sudoers_sid | ||
vars: | ||
hana_sudoers_sid_list: "{{ hana_sudoers_sids is defined | ternary(hana_sudoers_sids | flatten, hana_sudoers_sid_list_installed) }}" | ||
hana_sudoers_sid_list_installed: "{{ hana_sudoers_host_info | default([]) | select('sap.sap_operations.hana_instance') }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 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/>. | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# 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/>. | ||
|
||
--- | ||
- name: Make sure sudoers file is configured | ||
ansible.builtin.lineinfile: | ||
create: true | ||
path: "{{ hana_sudoers_path }}" | ||
state: "{{ hana_sudoers_state }}" | ||
regexp: "{{ line | ansible.builtin.regex_escape }}" | ||
line: "{{ line }}" | ||
validate: '/usr/sbin/visudo --check --file=%s' | ||
owner: "{{ omit }}" | ||
group: "{{ omit }}" | ||
mode: "{{ omit }}" | ||
loop: "{{ hana_sudoers_file_lines }}" | ||
loop_control: | ||
loop_var: line | ||
become: true | ||
become_user: root |
Oops, something went wrong.