diff --git a/smartgears/dataminer_app/tasks/dataminer-app.yml b/smartgears/dataminer_app/tasks/dataminer-app.yml index adc0e38a..08239849 100644 --- a/smartgears/dataminer_app/tasks/dataminer-app.yml +++ b/smartgears/dataminer_app/tasks/dataminer-app.yml @@ -60,9 +60,19 @@ tags: [ 'tomcat', 'dataminer', 'wps' ] - block: - - name: Reconfigure the Java environment for R - shell: export JAVA_HOME=/usr/lib/jvm/java-8-oracle ; export J2SDKDIR=/usr/lib/jvm/java-8-oracle ; export J2REDIR=/usr/lib/jvm/java-8-oracle/jre ; R CMD javareconf + - name: Verify if R is installed + stat: path=/usr/bin/R + register: r_installed + + - name: Configure the JDK environment + shell: export JAVA_HOME={{ jdk_java_home }} ; export J2SDKDIR={{ jdk_java_home }} ; export J2REDIR={{ jdk_java_home }}/jre ; R CMD javareconf ; touch /etc/R/.java{{ jdk_default }}.env_conf + args: + creates: '/etc/R/.java{{ jdk_default }}.env_conf' + when: + - jdk_java_home is defined + - jdk_default is defined + - r_installed.stat.executable is defined and r_installed.stat.executable become: True become_user: root - tags: [ 'tomcat', 'dataminer', 'wps' ] + tags: [ 'tomcat', 'dataminer', 'wps', 'r_java' ]