Skip to content
This repository was archived by the owner on Sep 8, 2023. It is now read-only.

Commit

Permalink
TINSTL-2595: Create SAP RFC Server-specific installation tasks (#69)
Browse files Browse the repository at this point in the history
* TINSTL-2595: Created SAP RFC Server-specific installation tasks.

* TINSTL-2595: Created TCOMP- and TDP-specific installation tasks

* TINSTL-2595: Fixed installation tasks

* TINSTL-2595: Refactored rpm/yum installation tasks without Tomcat
  • Loading branch information
gdalencon authored Jan 24, 2023
1 parent 9f89197 commit f4e32e1
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 6 deletions.
27 changes: 27 additions & 0 deletions ansible/roles/common/tasks/install_rpm_no_tomcat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# This file handles installation with rpm (when non-default prefix is used)
# This script expects that check_status.yml was run before
# So the following two variables expected to be set:
# - rpm_is_installed
# - rpm_install_path

- name: "{{ app_name }} RPM is already installed with correct path"
when: install_prefix != '/opt/talend' and rpm_is_installed.stdout != '' and rpm_install_path.stdout == install_prefix
debug:
msg: "{{ app_name }} RPM is already installed"

- name: "Check if {{ app_name }} RPM is already installed into other path"
fail:
msg: "FATAL: {{ app_name }} package is already installed with a different prefix {{ rpm_install_path.stdout }} !"
when: install_prefix != '/opt/talend' and rpm_is_installed.stdout != '' and rpm_install_path.stdout != install_prefix

- name: "Install {{ app_name }} with rpm (non-default folder)"
when: install_prefix != '/opt/talend' and (rpm_is_installed.stdout == '' or rpm_install_path.stdout != install_prefix)
command: "rpm -i --prefix={{ install_prefix }} {{ rpm_repo_url }}/{{ rpm_name }}-{{ rpm_pkg_version }}.x86_64.rpm"
args:
warn: no
environment:
TALEND_INSTALL_USER: "{{ install_user }}"
TALEND_INSTALL_GROUP: "{{ install_group }}"
TALEND_INSTALL_SYSTEMD: "{{ '1' if app_install_systemd == 'yes' else '0' }}"
JAVA_HOME: "{{ java_dir.stdout }}"
13 changes: 13 additions & 0 deletions ansible/roles/common/tasks/install_yum_no_tomcat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
# This file handles installation with yum (to default folder /opt/talend)
#
- name: "Install {{ app_name }} with yum"
when: rpm_is_installed.stdout == ''
yum:
name: "{{ rpm_name }}"
state: present
environment:
TALEND_INSTALL_USER: "{{ install_user }}"
TALEND_INSTALL_GROUP: "{{ install_group }}"
TALEND_INSTALL_SYSTEMD: "{{ '1' if app_install_systemd == 'yes' else '0' }}"
JAVA_HOME: "{{ java_dir.stdout }}"
4 changes: 2 additions & 2 deletions ansible/roles/sap-rfc-server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
- include_tasks: ../../common/tasks/stop_service.yml

# We will include installation with yum or with rpm depending of prefix used
- include_tasks: ../../common/tasks/install_yum.yml
- include_tasks: ../../common/tasks/install_yum_no_tomcat.yml
when: install_prefix == '/opt/talend'

- include_tasks: ../../common/tasks/install_rpm.yml
- include_tasks: ../../common/tasks/install_rpm_no_tomcat.yml
when: install_prefix != '/opt/talend'

# Update configuration
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/tcomp/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
- include_tasks: ../../common/tasks/stop_service.yml

# We will include installation with yum or with rpm depending of prefix used
- include_tasks: ../../common/tasks/install_yum.yml
- include_tasks: ../../common/tasks/install_yum_no_tomcat.yml
when: install_prefix == '/opt/talend'

- include_tasks: ../../common/tasks/install_rpm.yml
- include_tasks: ../../common/tasks/install_rpm_no_tomcat.yml
when: install_prefix != '/opt/talend'

# Patch installation if installing into non-default folder
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/tdp/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
app_service: "{{ app_service_mod }}"

# We will include installation with yum or with rpm depending of prefix used
- include_tasks: ../../common/tasks/install_yum.yml
- include_tasks: ../../common/tasks/install_yum_no_tomcat.yml
when: install_prefix == '/opt/talend'
vars:
rpm_name: "{{ rpm_name_mod }}"

- include_tasks: ../../common/tasks/install_rpm.yml
- include_tasks: ../../common/tasks/install_rpm_no_tomcat.yml
when: install_prefix != '/opt/talend'
vars:
rpm_name: "{{ rpm_name_mod }}"
Expand Down

0 comments on commit f4e32e1

Please sign in to comment.