You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by om...@apache.org on 2020/01/21 14:37:28 UTC

[incubator-dlab] branch develop updated: Fixed issue with Java installation

This is an automated email from the ASF dual-hosted git repository.

omartushevskyi pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git


The following commit(s) were added to refs/heads/develop by this push:
     new d2664ce  Fixed issue with Java installation
d2664ce is described below

commit d2664ce38baaa1f52a71c5d201664fe4b7e23402
Author: Oleh Martushevskyi <Ol...@epam.com>
AuthorDate: Tue Jan 21 16:37:16 2020 +0200

    Fixed issue with Java installation
---
 .../src/general/lib/os/debian/common_lib.py                    | 10 +++++++++-
 .../src/general/lib/os/redhat/common_lib.py                    | 10 +++++++++-
 .../src/ssn/scripts/configure_ssn_node.py                      |  3 +++
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
index d2f78f1..916c48c 100644
--- a/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/debian/common_lib.py
@@ -103,10 +103,18 @@ def ensure_ntpd(user, edge_private_ip=''):
         sys.exit(1)
 
 
+def ensure_java(user):
+    try:
+        if not exists('/home/{}/.ensure_dir/java_ensured'.format(user)):
+            sudo('apt-get -y install openjdk-8-jdk')
+            sudo('touch /home/{}/.ensure_dir/java_ensured'.format(user))
+    except:
+        sys.exit(1)
+
+
 def ensure_step(user):
     try:
         if not exists('/home/{}/.ensure_dir/step_ensured'.format(user)):
-            sudo('apt-get -y install openjdk-8-jdk')
             sudo('apt-get install -y wget')
             sudo('wget https://github.com/smallstep/cli/releases/download/v0.13.3/step-cli_0.13.3_amd64.deb '
                  '-O /tmp/step-cli_0.13.3_amd64.deb')
diff --git a/infrastructure-provisioning/src/general/lib/os/redhat/common_lib.py b/infrastructure-provisioning/src/general/lib/os/redhat/common_lib.py
index f196a8b..fa57572 100644
--- a/infrastructure-provisioning/src/general/lib/os/redhat/common_lib.py
+++ b/infrastructure-provisioning/src/general/lib/os/redhat/common_lib.py
@@ -92,10 +92,18 @@ def ensure_ntpd(user, edge_private_ip=''):
         sys.exit(1)
 
 
+def ensure_java(user):
+    try:
+        if not exists('/home/{}/.ensure_dir/java_ensured'.format(user)):
+            sudo('yum -y install java-1.8.0-openjdk-devel')
+            sudo('touch /home/{}/.ensure_dir/java_ensured'.format(user))
+    except:
+        sys.exit(1)
+
+
 def ensure_step(user):
     try:
         if not exists('/home/{}/.ensure_dir/step_ensured'.format(user)):
-            sudo('yum -y install java-1.8.0-openjdk-devel')
             sudo('yum install -y wget')
             sudo('wget https://github.com/smallstep/cli/releases/download/v0.13.3/step_0.13.3_linux_amd64.tar.gz '
                  '-O /tmp/step_0.13.3_linux_amd64.tar.gz')
diff --git a/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py b/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
index 2e9f870..42a6a09 100644
--- a/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
+++ b/infrastructure-provisioning/src/ssn/scripts/configure_ssn_node.py
@@ -234,6 +234,9 @@ if __name__ == "__main__":
     print("Installing nginx as frontend.")
     ensure_nginx(args.dlab_path)
 
+    print("Installing Java")
+    ensure_java(args.os_user)
+
     print("Configuring ssl key and cert for nginx.")
     configure_ssl_certs(args.hostname, custom_ssl_cert)
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org