Merge branch 'master' of andrea.dellamico/ansible-playbooks into master

This commit is contained in:
Andrea Dell'Amico 2019-04-30 13:03:36 +02:00 committed by Gitea
commit f5f2ee34ce
2 changed files with 64 additions and 0 deletions

View File

@ -1,4 +1,5 @@
---
- import_tasks: set_jdk_home.yml
- import_tasks: smartgears-app.yml
- import_tasks: data-transfer-service.yml
when: data_transfer_service_install

View File

@ -0,0 +1,63 @@
---
- block:
- name: Are we using the distribution OpenJDK?
stat:
path: /usr/lib/jvm/java-{{ openjdk_default }}-openjdk-amd64
register: jdk_java_home_path
when: openjdk_default is defined
- debug:
msg: 'The jdk java home is {{ jdk_java_home_path.stat.path }}'
when: jdk_java_home_path.stat.path is defined
- name: Set the Java home when we are using the distribution OpenJDK
set_fact:
jdk_java_home: '{{ jdk_java_home_path.stat.path }}'
when: jdk_java_home_path.stat.isdir is defined and jdk_java_home_path.stat.isdir
when: jdk_java_home is not defined
tags: [ 'smartgears', 'smartgears_distribution', 'tomcat' ]
- block:
- name: Are we using the Zulu OpenJDK?
stat:
path: /usr/lib/jvm/zulu-{{ openjdk_default }}-amd64
register: jdk_java_home_path
when: openjdk_default is defined
- debug:
msg: 'The jdk java home is {{ jdk_java_home_path.stat.path }}'
when: jdk_java_home_path.stat.path is defined
- name: Set the Java home when we are using the distribution OpenJDK
set_fact:
jdk_java_home: '{{ jdk_java_home_path.stat.path }}'
when: jdk_java_home_path.stat.isdir is defined and jdk_java_home_path.stat.isdir
when: jdk_java_home is not defined
tags: [ 'smartgears', 'smartgears_distribution', 'tomcat' ]
- block:
- name: Are we using the Oracle JDK?
stat:
path: /usr/lib/jvm/java-{{ jdk_default }}-oracle
register: jdk_java_home_path
when: openjdk_default is not defined
- debug:
msg: 'The jdk java home is {{ jdk_java_home_path.stat.path }}'
when: jdk_java_home_path.stat.path is defined
- name: Set the Java home when we are using the Oracle JDK
set_fact:
jdk_java_home: '{{ jdk_java_home_path.stat.path }}'
when: jdk_java_home_path.stat.isdir is defined and jdk_java_home_path.stat.isdir
when: jdk_java_home is not defined
tags: [ 'smartgears', 'smartgears_distribution', 'tomcat' ]
- name: Fail if we are not able to set the jdk_java_home variable
fail:
msg: 'No valid JDK installation found, failing!'
when: jdk_java_home is not defined
tags: [ 'smartgears', 'smartgears_distribution', 'tomcat' ]