This repository has been archived by the owner on Mar 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from berndfinger/master
solve issues 57...63;65...77
- Loading branch information
Showing
26 changed files
with
272 additions
and
206 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
--- | ||
# handlers file for sap-preconfigure | ||
|
||
- name: "Reboot handler" | ||
fail: | ||
msg: Reboot is required! | ||
when: sap_preconfigure_fail_if_reboot_required|d(true) | ||
|
||
... |
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
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
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,16 @@ | ||
--- | ||
# tasks file for sap-preconfigure: configuration | ||
|
||
# 05-configure-firewall.yml | ||
|
||
- debug: | ||
msg: "imported RedHat/generic/configure-firewall.yml" | ||
|
||
- name: Stop and disable service firewalld | ||
systemd: | ||
name: firewalld | ||
state: stopped | ||
enabled: no | ||
when: "'firewalld' in ansible_facts.packages" | ||
|
||
... |
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,18 @@ | ||
--- | ||
# tasks file for sap-preconfigure: configuration | ||
|
||
- debug: | ||
msg: "imported RedHat/generic/configure-selinux.yml" | ||
|
||
- name: Set SELinux State | ||
selinux: | ||
state: "{{ sap_preconfigure_selinux_state }}" | ||
policy: targeted | ||
register: selinux_result | ||
|
||
- name: Call Reboot handler if necessary | ||
command: /bin/true | ||
notify: "Reboot handler" | ||
when: selinux_result.reboot_required == true | ||
|
||
... |
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,16 @@ | ||
--- | ||
# tasks file for sap-preconfigure: configuration | ||
|
||
- debug: | ||
msg: "imported RedHat/generic/configure-systemd-tmpfiles.yml" | ||
|
||
- name: Copy file /etc/tmpfiles.d/sap.conf | ||
copy: | ||
src: etc/tmpfiles.d/sap.conf | ||
dest: /etc/tmpfiles.d/sap.conf | ||
owner: root | ||
group: root | ||
mode: '0644' | ||
backup: yes | ||
|
||
... |
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
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
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 |
---|---|---|
@@ -1,33 +1,87 @@ | ||
--- | ||
# tasks file for sap-preconfigure: installation | ||
|
||
- name: ensure minimal required packages are installed | ||
- name: Ensure required package groups are installed | ||
package: | ||
state: present | ||
name: "{{ sap_preconfigure_min_pkgs }}" | ||
when: | ||
- sap_preconfigure_min_package_check|bool | ||
- not( (sap_preconfigure_min_pkgs is undefined) or (sap_preconfigure_min_pkgs is none) or (sap_preconfigure_min_pkgs | trim == '') ) | ||
|
||
- name: ensure required package groups are installed | ||
package: | ||
state: present | ||
name: "{{ sap_preconfigure_packagegroups }}" | ||
check_mode: "{{ sap_preconfigure_installation_check_only }}" | ||
name: "{{ __sap_preconfigure_packagegroups }}" | ||
|
||
- name: ensure required packages are installed | ||
- name: Ensure required packages are installed | ||
package: | ||
state: present | ||
name: "{{ sap_preconfigure_packages }}" | ||
check_mode: "{{ sap_preconfigure_installation_check_only }}" | ||
name: "{{ __sap_preconfigure_packages }}" | ||
register: sap_preconfigure_register_groupinstall | ||
|
||
- name: ensure system is updated to the latest patchlevel | ||
- name: Ensure minimum packages are installed | ||
block: | ||
- name: check if minimum release needs to be installed | ||
shell: | | ||
set -x | ||
required_pkg={{ pkg | join('-') }} | ||
newest=$(echo -e "$required_pkg\n$(rpm -q {{ pkg[0] }} )"| sort -V | tail -1) | ||
if [ $newest == $required_pkg ]; then | ||
echo $newest | ||
fi | ||
loop: "{{ __sap_preconfigure_min_pkgs }}" | ||
loop_control: | ||
loop_var: pkg | ||
check_mode: no | ||
register: __sap_preconfigure_register_minpkglist | ||
changed_when: false | ||
|
||
- name: Initialize an empty list for our strings | ||
set_fact: | ||
__sap_preconfigure_fact_minpkglist: [] | ||
|
||
- name: Create list of packages to be installed | ||
set_fact: | ||
__sap_preconfigure_fact_minpkglist: "{{ __sap_preconfigure_fact_minpkglist | difference(['']) + [ pkg.stdout ] }}" | ||
loop: "{{ __sap_preconfigure_register_minpkglist.results }}" | ||
loop_control: | ||
loop_var: pkg | ||
- debug: var=__sap_preconfigure_fact_minpkglist | ||
|
||
- name: Install minimum packages if required | ||
package: | ||
name: "{{ __sap_preconfigure_fact_minpkglist }}" | ||
state: present | ||
when: not ( __sap_preconfigure_fact_minpkglist == [ "" ] ) | ||
|
||
when: | ||
- sap_preconfigure_min_package_check|bool | ||
- not( (__sap_preconfigure_min_pkgs is undefined) or (__sap_preconfigure_min_pkgs is none) or (__sap_preconfigure_min_pkgs | trim == '') ) | ||
|
||
- name: Ensure system is updated to the latest patchlevel | ||
package: | ||
state: latest | ||
name: "*" | ||
when: sap_preconfigure_update | ||
check_mode: "{{ sap_preconfigure_installation_check_only }}" | ||
register: sap_preconfigure_register_packageinstall | ||
|
||
- set_fact: | ||
needs_restarting_command: "needs-restarting -r" | ||
when: | ||
- ansible_os_family == 'RedHat' | ||
- ansible_distribution_major_version == '7' | ||
|
||
- set_fact: | ||
needs_restarting_command: "yum needs-restarting -r" | ||
when: | ||
- ansible_os_family == 'RedHat' | ||
- ansible_distribution_major_version == '8' | ||
|
||
- name: Check if system needs to be restarted | ||
command: "{{ needs_restarting_command }}" | ||
register: needs_restarting_result | ||
ignore_errors: true | ||
changed_when: false | ||
args: | ||
warn: false | ||
check_mode: false | ||
|
||
- name: Call Reboot handler if necessary | ||
command: /bin/true | ||
notify: "Reboot handler" | ||
when: needs_restarting_result.rc == 1 | ||
|
||
... |
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
Oops, something went wrong.