From 52d2e8ac83a30d30e115892ccc324832a17846e2 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 20 Jan 2021 08:52:17 -0600 Subject: [PATCH] CLDR-14399 move to OpenLiberty, add API server --- .github/workflows/maven.yml | 17 +- .gitignore | 5 + tools/cldr-apps/.factorypath | 5 +- .../.settings/org.eclipse.jdt.apt.core.prefs | 6 +- .../org.eclipse.wst.common.component | 42 +++-- ...se.wst.common.project.facet.core.prefs.xml | 12 ++ ....eclipse.wst.common.project.facet.core.xml | 2 + tools/cldr-apps/README.md | 8 +- tools/cldr-apps/pom.xml | 160 +++++++++++------- .../org/unicode/cldr/util/CLDRConfigImpl.java | 16 ++ .../java/org/unicode/cldr/web/DBUtils.java | 90 ++++++---- .../cldr/web/api/SurveyToolApplication.java | 9 + .../org/unicode/cldr/web/api/XPathAPI.java | 27 +++ .../src/main/liberty/config/server.env.sample | 4 + .../src/main/liberty/config/server.xml | 41 +++++ .../src/main/webapp/WEB-INF/ibm-web-ext.xml | 15 ++ .../cldr-apps/src/main/webapp/WEB-INF/web.xml | 94 +++------- .../java/com/ibm/icu/dev/test/TestFmwk.java | 5 +- .../org/unicode/cldr/util/FileReaders.java | 2 + tools/pom.xml | 34 +--- tools/scripts/ansible/Vagrantfile | 1 + tools/scripts/ansible/cldr-apps-playbook.yml | 24 ++- tools/scripts/ansible/nginx-playbook.yml | 10 +- .../scripts/ansible/openliberty-playbook.yml | 85 ++++++++++ tools/scripts/ansible/redact-db-playbook.yml | 8 +- tools/scripts/ansible/requirements.yml | 21 ++- .../ansible/roles/openliberty/.travis.yml | 29 ++++ .../ansible/roles/openliberty/README.md | 38 +++++ .../roles/openliberty/defaults/main.yml | 2 + .../roles/openliberty/handlers/main.yml | 2 + .../ansible/roles/openliberty/meta/main.yml | 24 +++ .../ansible/roles/openliberty/tasks/main.yml | 21 +++ .../ansible/roles/openliberty/tests/inventory | 2 + .../ansible/roles/openliberty/tests/test.yml | 5 + .../ansible/roles/openliberty/vars/main.yml | 2 + tools/scripts/ansible/server-playbook.yml | 2 + tools/scripts/ansible/setup-playbook.yml | 3 +- .../ansible/templates/bootstrap-properties.j2 | 7 + tools/scripts/ansible/templates/context.j2 | 16 -- tools/scripts/ansible/templates/server-env.j2 | 7 + tools/scripts/ansible/templates/server.xml | 136 --------------- tools/scripts/ansible/templates/st-readme.j2 | 9 + tools/scripts/ansible/templates/users.j2 | 8 - tools/scripts/ansible/tomcat-playbook.yml | 51 ------ tools/scripts/ansible/vagrant-playbook.yml | 1 + tools/scripts/ansible/vars/main.yml | 21 ++- tools/scripts/ansible/vars/openliberty.yml | 10 ++ tools/scripts/ansible/vars/tomcat.yml | 15 -- 48 files changed, 671 insertions(+), 483 deletions(-) create mode 100644 tools/cldr-apps/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml create mode 100644 tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/SurveyToolApplication.java create mode 100644 tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/XPathAPI.java create mode 100644 tools/cldr-apps/src/main/liberty/config/server.env.sample create mode 100644 tools/cldr-apps/src/main/liberty/config/server.xml create mode 100644 tools/cldr-apps/src/main/webapp/WEB-INF/ibm-web-ext.xml create mode 100644 tools/scripts/ansible/openliberty-playbook.yml create mode 100644 tools/scripts/ansible/roles/openliberty/.travis.yml create mode 100644 tools/scripts/ansible/roles/openliberty/README.md create mode 100644 tools/scripts/ansible/roles/openliberty/defaults/main.yml create mode 100644 tools/scripts/ansible/roles/openliberty/handlers/main.yml create mode 100644 tools/scripts/ansible/roles/openliberty/meta/main.yml create mode 100644 tools/scripts/ansible/roles/openliberty/tasks/main.yml create mode 100644 tools/scripts/ansible/roles/openliberty/tests/inventory create mode 100644 tools/scripts/ansible/roles/openliberty/tests/test.yml create mode 100644 tools/scripts/ansible/roles/openliberty/vars/main.yml create mode 100644 tools/scripts/ansible/templates/bootstrap-properties.j2 delete mode 100644 tools/scripts/ansible/templates/context.j2 create mode 100644 tools/scripts/ansible/templates/server-env.j2 delete mode 100644 tools/scripts/ansible/templates/server.xml create mode 100644 tools/scripts/ansible/templates/st-readme.j2 delete mode 100644 tools/scripts/ansible/templates/users.j2 delete mode 100644 tools/scripts/ansible/tomcat-playbook.yml create mode 100644 tools/scripts/ansible/vars/openliberty.yml delete mode 100644 tools/scripts/ansible/vars/tomcat.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 82aea7adb91..37c0902a077 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -32,6 +32,17 @@ jobs: -DskipTests=true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Build liberty server + run: > + mvn -s .github/workflows/mvn-settings.xml -B -pl cldr-apps liberty:package --file tools/pom.xml + -DskipTests=true -Dinclude=usr + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload cldr-apps.zip + uses: actions/upload-artifact@v2 + with: + name: cldr-apps-server + path: tools/cldr-apps/target/cldr-apps.zip - name: Upload cldr-apps.war uses: actions/upload-artifact@v2 with: @@ -86,11 +97,11 @@ jobs: - check runs-on: ubuntu-latest steps: - - name: Download cldr-apps.war + - name: Download cldr-apps.zip uses: actions/download-artifact@v2 with: - name: cldr-apps - - name: Deploy to cldr-smoke (experimental) + name: cldr-apps-server + - name: Deploy to cldr-smoke # Deploys only on push to master. # Does not deploy for PRs. if: ${{ github.event_name == 'push' }} diff --git a/.gitignore b/.gitignore index 13455c787a2..b4e1f915090 100644 --- a/.gitignore +++ b/.gitignore @@ -78,3 +78,8 @@ /tools/cldr-code/.build.properties.swp /tools/cldr-code/doc +# ignore temporary config files here +/tools/cldr-apps/src/main/liberty/config/server.env +/tools/cldr-apps/src/main/liberty/config/bootstrap.properties + + diff --git a/tools/cldr-apps/.factorypath b/tools/cldr-apps/.factorypath index aab59cf4b4d..85469f18e1b 100644 --- a/tools/cldr-apps/.factorypath +++ b/tools/cldr-apps/.factorypath @@ -1,5 +1,4 @@ - - - + + diff --git a/tools/cldr-apps/.settings/org.eclipse.jdt.apt.core.prefs b/tools/cldr-apps/.settings/org.eclipse.jdt.apt.core.prefs index 8fd9110d7aa..007af44f09d 100644 --- a/tools/cldr-apps/.settings/org.eclipse.jdt.apt.core.prefs +++ b/tools/cldr-apps/.settings/org.eclipse.jdt.apt.core.prefs @@ -1,4 +1,4 @@ -#Mon May 03 15:03:41 PDT 2010 -org.eclipse.jdt.apt.processorOptions/com.ibm.ws.ast.jws.annotations.processor.validateWSDL=on -org.eclipse.jdt.apt.aptEnabled=true eclipse.preferences.version=1 +org.eclipse.jdt.apt.aptEnabled=true +org.eclipse.jdt.apt.processorOptions/com.ibm.ws.ast.jws.annotations.processor.validateWSDL=on +org.eclipse.jdt.apt.reconcileEnabled=true diff --git a/tools/cldr-apps/.settings/org.eclipse.wst.common.component b/tools/cldr-apps/.settings/org.eclipse.wst.common.component index e5bb5ee8385..c881fbae123 100644 --- a/tools/cldr-apps/.settings/org.eclipse.wst.common.component +++ b/tools/cldr-apps/.settings/org.eclipse.wst.common.component @@ -1,67 +1,79 @@ - + + - + + - + + - + + - + + - + + - + + + + + uses + + + uses + - - - - + - - - + + + - + + diff --git a/tools/cldr-apps/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/tools/cldr-apps/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 00000000000..c8e0439abb8 --- /dev/null +++ b/tools/cldr-apps/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tools/cldr-apps/.settings/org.eclipse.wst.common.project.facet.core.xml b/tools/cldr-apps/.settings/org.eclipse.wst.common.project.facet.core.xml index 107dda8062e..84cf445aaa8 100644 --- a/tools/cldr-apps/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/tools/cldr-apps/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -4,5 +4,7 @@ + + diff --git a/tools/cldr-apps/README.md b/tools/cldr-apps/README.md index ec71e3dd336..458617bfe6e 100644 --- a/tools/cldr-apps/README.md +++ b/tools/cldr-apps/README.md @@ -10,6 +10,12 @@ for CLDR. Please use the parent [CLDR/tools/pom.xml](../pom.xml) with maven to build and run. +- Copy `src/main/liberty/config/server.env.sample` to `src/main/liberty/config/server.env` +- Edit that `server.env` file to contain the MySQL credentials for the ST database +- Use `mvn --file=tools/pom.xml -pl cldr-apps liberty:dev` to run a development +web server, listening on port 9080 +- Navigate to http://localhost:9080/cldr-apps to view the app + See for further information about the Survey Tool. @@ -22,6 +28,6 @@ For more details, see the main [README.md](../../README.md). ### Copyright -Copyright © 1991-2020 Unicode, Inc. +Copyright © 1991-2021 Unicode, Inc. All rights reserved. [Terms of use](http://www.unicode.org/copyright.html) diff --git a/tools/cldr-apps/pom.xml b/tools/cldr-apps/pom.xml index cbd23ba746f..3e0c7af8e9a 100644 --- a/tools/cldr-apps/pom.xml +++ b/tools/cldr-apps/pom.xml @@ -15,6 +15,14 @@ scm:git:https://github.com/unicode-org/cldr.git + + + 8.0.0 + 3.3 + 9080 + 9443 + + org.unicode.cldr cldr-all @@ -22,6 +30,21 @@ + + + jakarta.platform + jakarta.jakartaee-api + ${jakarta-version} + provided + + + org.eclipse.microprofile + microprofile + ${microprofile-version} + pom + provided + + org.junit.jupiter @@ -54,23 +77,12 @@ cldr-rdf - + javax.servlet javax.servlet-api - provided - - - - javax.servlet.jsp - javax.servlet.jsp-api - provided - - - - javax.xml.bind - jaxb-api - provided + 4.0.1 + test @@ -94,8 +106,8 @@ - org.jsoup - jsoup + org.jsoup + jsoup org.apache.httpcomponents.client5 @@ -120,6 +132,7 @@ org.apache.derby derby + test @@ -147,57 +160,78 @@ - cldr-apps - - - - maven-clean-plugin - - - maven-compiler-plugin - - - org/**/*.java - - - - - maven-war-plugin - - - - ${user.name} - ${maven.build.timestamp} - ${buildNumber} - ${scmBranch} - - - - - - org.codehaus.mojo - buildnumber-maven-plugin - - - validate - - create - - - - - true - true - true - - - - + ${project.artifactId} + + maven-clean-plugin + + + maven-compiler-plugin + + + org/**/*.java + + + + + maven-war-plugin + org.apache.maven.plugins + 3.2.3 + + + + ${user.name} + ${maven.build.timestamp} + ${buildNumber} + ${scmBranch} + + + + + + io.openliberty.tools + liberty-maven-plugin + 3.3 + + cldr + + jdbc + + mysql + mysql-connector-java + ${mysql.version} + + + + + + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.2 + + + ${default.http.port} + ${default.https.port} + ${project.artifactId} + + + org.codehaus.mojo buildnumber-maven-plugin + + + validate + + create + + + + + true + true + true + diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRConfigImpl.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRConfigImpl.java index 680b7c40ec6..7b30deef723 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRConfigImpl.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/util/CLDRConfigImpl.java @@ -141,9 +141,25 @@ private synchronized void init() { survprops.put("CLDR_SURVEY_URL", "survey"); // default to relative URL. File propFile; + + // Try to use org.unicode.cldr.util.CLDRConfigImpl.cldrHome as a property + // Note that this specifies the entire path, not just the "parent" + try { + cldrHome = System.getProperty(CLDRConfigImpl.class.getName() + ".cldrHome", null); + if (!new File(cldrHome).isDirectory()) { + System.err.println(cldrHome + " is not a directory"); + cldrHome = null; + } + } catch(Throwable t) { + t.printStackTrace(); + cldrHome = null; + } + System.err.println(CLDRConfigImpl.class.getName() + ".init(), cldrHome=" + cldrHome); if (cldrHome == null) { String homeParent = null; + // all of these properties specify the "parent", i.e. the parent of a "cldr" dir. + // Deprecated, these are fallbacks for old behavior. String props[] = { "cldr.home", "catalina.base", "websphere.base", "catalina.home", "websphere.home", "user.dir" }; for (String prop : props) { if (homeParent == null) { diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/DBUtils.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/DBUtils.java index 99b99f00bb6..ee01a5bae23 100644 --- a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/DBUtils.java +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/DBUtils.java @@ -31,12 +31,12 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import javax.annotation.Resource; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; -import org.apache.derby.jdbc.EmbeddedDataSource; import org.apache.ibatis.jdbc.ScriptRunner; import org.json.JSONArray; import org.json.JSONException; @@ -145,8 +145,8 @@ public static void closeDBConnection(Connection conn) { tracker.remove(conn); } try { - if (db_Derby && - datasource instanceof EmbeddedDataSource && + if (db_Derby /*&& + datasource instanceof EmbeddedDataSource*/ && !conn.isClosed() && !conn.getAutoCommit()) { // commit on close if we are using Derby directly @@ -598,9 +598,17 @@ public static final String unchainSqlException(SQLException e) { static String dbInfo = null; public boolean isBogus() { - return (datasource == null); + return !hasDataSource(); } + private static final class ResourceHelper { + @Resource + public DataSource myDB; + } + + private static final ResourceHelper RESOURCE_HELPER = new ResourceHelper(); + + private DBUtils() { if(CLDRConfig.getInstance().getEnvironment() == Environment.UNITTEST) { System.err.println("NOT initializing datasource: UNITTEST environment. Must call DBUtils.makeInstanceFrom() before DB operations will work."); // makeInstanceFrom() must be called. @@ -609,41 +617,57 @@ private DBUtils() { // Initialize DB context System.err.println("Loading datasource: java:comp/env " + JDBC_SURVEYTOOL); ElapsedTimer et = new ElapsedTimer(); - try { - Context initialContext = new InitialContext(); - Context eCtx = (Context) initialContext.lookup("java:comp/env"); - datasource = (DataSource) eCtx.lookup(JDBC_SURVEYTOOL); - if (datasource != null) { - System.err.println("Got datasource: " + datasource.toString() + " in " + et); - } - Connection c = null; + + if (RESOURCE_HELPER.myDB != null) { + datasource = RESOURCE_HELPER.myDB; + System.err.println("Got default datasource: " + datasource.toString()); + } else { + System.err.println("myDB was null.."); try { + final DataSource myOtherDB = InitialContext.doLookup("java:comp/DefaultDataSource"); + + if(myOtherDB != null) { + System.err.println("DefaultDataSource was ok"); + datasource = myOtherDB; + } else { + System.err.println("DefaultDataSource was not OK"); + Context initialContext = new InitialContext(); + Context eCtx = (Context) initialContext.lookup("java:comp/env"); + datasource = (DataSource) eCtx.lookup(JDBC_SURVEYTOOL); + } + if (datasource != null) { - c = datasource.getConnection(); - DatabaseMetaData dmd = c.getMetaData(); - dbInfo = dmd.getDatabaseProductName() + " v" + dmd.getDatabaseProductVersion() + " " + - "driver " + dmd.getDriverName() + " ver " + dmd.getDriverVersion(); - setupSqlForServerType(); - SurveyLog.debug("Metadata: " + dbInfo); + System.err.println("Got datasource: " + datasource.toString() + " in " + et); } - } catch (SQLException t) { - datasource = null; - throw new IllegalArgumentException(getClass().getName() + ": WARNING: we require a JNDI datasource. " + "'" - + JDBC_SURVEYTOOL + "'" + ".getConnection() returns : " + t.toString() + "\n" + unchainSqlException(t)); - } finally { - if (c != null) - try { - c.close(); - } catch (Throwable tt) { - System.err.println("Couldn't close datasource's conn: " + tt.toString()); - tt.printStackTrace(); + Connection c = null; + try { + if (datasource != null) { + c = datasource.getConnection(); + DatabaseMetaData dmd = c.getMetaData(); + dbInfo = dmd.getDatabaseProductName() + " v" + dmd.getDatabaseProductVersion() + " " + + "driver " + dmd.getDriverName() + " ver " + dmd.getDriverVersion(); + setupSqlForServerType(); + SurveyLog.debug("Metadata: " + dbInfo); } + } catch (SQLException t) { + datasource = null; + throw new IllegalArgumentException(getClass().getName() + ": WARNING: we require a JNDI datasource. " + "'" + + JDBC_SURVEYTOOL + "'" + ".getConnection() returns : " + t.toString() + "\n" + unchainSqlException(t)); + } finally { + if (c != null) + try { + c.close(); + } catch (Throwable tt) { + System.err.println("Couldn't close datasource's conn: " + tt.toString()); + tt.printStackTrace(); + } + } + } catch (NamingException nc) { + nc.printStackTrace(); + datasource = null; + throw new Error("Couldn't load context " + JDBC_SURVEYTOOL + " - not using datasource.", nc); } - } catch (NamingException nc) { - nc.printStackTrace(); - datasource = null; - throw new Error("Couldn't load context " + JDBC_SURVEYTOOL + " - not using datasource.", nc); } } diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/SurveyToolApplication.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/SurveyToolApplication.java new file mode 100644 index 00000000000..34f1ad3a93e --- /dev/null +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/SurveyToolApplication.java @@ -0,0 +1,9 @@ +package org.unicode.cldr.web.api; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("/api") +public class SurveyToolApplication extends Application { + +} diff --git a/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/XPathAPI.java b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/XPathAPI.java new file mode 100644 index 00000000000..72f971ef5cf --- /dev/null +++ b/tools/cldr-apps/src/main/java/org/unicode/cldr/web/api/XPathAPI.java @@ -0,0 +1,27 @@ +package org.unicode.cldr.web.api; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.eclipse.microprofile.openapi.annotations.Operation; +import org.eclipse.microprofile.openapi.annotations.parameters.Parameter; +import org.unicode.cldr.web.CookieSession; + +@Path("/xpath") +public class XPathAPI { + @GET @Path("{hexId}") + @Produces(MediaType.TEXT_PLAIN) + @Operation( + summary = "Fetch XPath string from hex id", + description = "Looks up a specific hex ID.") + public Response getByHex( + @Parameter(required = true, example = "1234abcd") String hexId) { + + // the actual implementation + return Response.ok(CookieSession.sm.xpt.getByStringID(hexId)).build(); + } + +} diff --git a/tools/cldr-apps/src/main/liberty/config/server.env.sample b/tools/cldr-apps/src/main/liberty/config/server.env.sample new file mode 100644 index 00000000000..351daf1ad07 --- /dev/null +++ b/tools/cldr-apps/src/main/liberty/config/server.env.sample @@ -0,0 +1,4 @@ +# copy this to server.env and set the password properly +MYSQL_USER=surveytool +MYSQL_PASSWORD=hunter42 +MYSQL_DB=cldrdb diff --git a/tools/cldr-apps/src/main/liberty/config/server.xml b/tools/cldr-apps/src/main/liberty/config/server.xml new file mode 100644 index 00000000000..f0f3adc58cb --- /dev/null +++ b/tools/cldr-apps/src/main/liberty/config/server.xml @@ -0,0 +1,41 @@ + + + + jaxrs-2.1 + jsp-2.3 + jdbc-4.3 + jndi-1.0 + mpOpenAPI-1.1 + mpConfig-1.4 + + + + + + + + + + + + + + + + + + + + + + diff --git a/tools/cldr-apps/src/main/webapp/WEB-INF/ibm-web-ext.xml b/tools/cldr-apps/src/main/webapp/WEB-INF/ibm-web-ext.xml new file mode 100644 index 00000000000..10f91ae472b --- /dev/null +++ b/tools/cldr-apps/src/main/webapp/WEB-INF/ibm-web-ext.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/tools/cldr-apps/src/main/webapp/WEB-INF/web.xml b/tools/cldr-apps/src/main/webapp/WEB-INF/web.xml index 41cdf18128b..a5d0a546aed 100644 --- a/tools/cldr-apps/src/main/webapp/WEB-INF/web.xml +++ b/tools/cldr-apps/src/main/webapp/WEB-INF/web.xml @@ -1,40 +1,14 @@ - - - - CLDR Web Applications - Applications used by the CLDR project ( + + CLDR Web Applications + Applications used by the CLDR project ( http://www.unicode.org/cldr ) - + - + jsp compilerSourceVM @@ -47,21 +21,18 @@ SurveyMain - - org.unicode.cldr.web.SurveyMain - + org.unicode.cldr.web.SurveyMain 1 FeedBack - - org.unicode.cldr.web.FeedBack - + org.unicode.cldr.web.FeedBack v org.unicode.cldr.web.SurveyTool + SurveyMain /survey/* @@ -74,28 +45,17 @@ /index.jsp - - SurveyAjax + + SurveyAjax SurveyAjax org.unicode.cldr.web.SurveyAjax - - ExpiresFilter - org.apache.catalina.filters.ExpiresFilter - - ExpiresByType image - access plus 10 minutes - - - ExpiresByType text/css - access plus 10 minutes - - - ExpiresByType text/javascript - access plus 5 minutes - - - + SurveyAjax /SurveyAjax @@ -108,12 +68,8 @@ Database used by the SurveyTool. - - jdbc/SurveyTool - - - javax.sql.DataSource - + jdbc/SurveyTool + javax.sql.DataSource Container @@ -121,12 +77,8 @@ org.apache.commons.fileupload.servlet.FileCleanerCleanup - - ExpiresFilter - /* - REQUEST - - + clearReferencesStopTimerThreads true diff --git a/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestFmwk.java b/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestFmwk.java index f06356935b5..d4de6628035 100644 --- a/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestFmwk.java +++ b/tools/cldr-code/src/main/java/com/ibm/icu/dev/test/TestFmwk.java @@ -2001,10 +2001,9 @@ public static String sourceLocation(Throwable forThrowable) { // Walk up the stack to the first call site outside this file for (StackTraceElement st : new Throwable().getStackTrace()) { String source = st.getFileName(); - if(source.equals("TestShim.java")) { + if(source == null || source.equals("TestShim.java")) { return ""; // hit the end of helpful stack traces - } - if (source != null && !source.equals("TestFmwk.java") + } else if (source != null && !source.equals("TestFmwk.java") && !source.equals("AbstractTestLog.java")) { String methodName = st.getMethodName(); if(methodName != null && methodName.startsWith("lambda$")) { // unpack inner lambda diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/util/FileReaders.java b/tools/cldr-code/src/main/java/org/unicode/cldr/util/FileReaders.java index e7bd914a10c..d31cfbf2367 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/util/FileReaders.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/util/FileReaders.java @@ -78,6 +78,8 @@ public static String getRelativeFileName(Class class1, String filename) { return resourceString.substring(5); } else if (resourceString.startsWith("jar:file:")) { return resourceString.substring(9); + } else if (resourceString.startsWith("wsjar:file:")) { + return resourceString.substring(11); } else { throw new IllegalArgumentException("File not found: " + resourceString); } diff --git a/tools/pom.xml b/tools/pom.xml index a629900b3fa..40e4228cb39 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -17,6 +17,7 @@ UTF-8 + UTF-8 1.8 1.8 + 8.0.22 @@ -113,30 +116,7 @@ commons-io 2.4 - - - - - javax.servlet - javax.servlet-api - 3.1.0 - provided - - - - javax.servlet.jsp - javax.servlet.jsp-api - 2.3.1 - provided - - - - javax.xml.bind - jaxb-api - 2.3.1 - provided - - + @@ -180,7 +160,7 @@ mysql mysql-connector-java - 8.0.21 + ${mysql.version} @@ -252,10 +232,6 @@ maven-jar-plugin 3.0.2 - - maven-war-plugin - 3.2.2 - maven-install-plugin 2.5.2 diff --git a/tools/scripts/ansible/Vagrantfile b/tools/scripts/ansible/Vagrantfile index cf23cd9b191..d3b77ac61bc 100644 --- a/tools/scripts/ansible/Vagrantfile +++ b/tools/scripts/ansible/Vagrantfile @@ -12,6 +12,7 @@ Vagrant.configure("2") do |config| config.vm.hostname = "surveytool" # forward http and https config.vm.network "forwarded_port", guest: 80, host: 8880 + config.vm.network "forwarded_port", guest: 9080, host: 9081 # Just the minimum to get ansible going config.vm.provision "shell", inline: <<-SHELL apt-get update diff --git a/tools/scripts/ansible/cldr-apps-playbook.yml b/tools/scripts/ansible/cldr-apps-playbook.yml index 6ad6ee8dacf..17401373680 100644 --- a/tools/scripts/ansible/cldr-apps-playbook.yml +++ b/tools/scripts/ansible/cldr-apps-playbook.yml @@ -8,8 +8,8 @@ file: path: "{{ cldr_path }}" state: directory - owner: "{{ cldr_tomcat_user }}" - group: "{{ cldr_tomcat_group }}" + owner: "{{ cldr_openliberty_user }}" + group: "{{ cldr_openliberty_group }}" mode: 0775 - name: Rotate CLDR logs blockinfile: @@ -18,7 +18,7 @@ mode: "0644" block: | {{ cldr_path }}/cldrmail.log {{ cldr_path }}/exception.log { - su {{ cldr_tomcat_user }} {{ cldr_tomcat_group }} + su {{ cldr_openliberty_user }} {{ cldr_openliberty_group }} daily rotate 14 compress @@ -28,15 +28,23 @@ create } create: true + - name: create st/README.md + template: + dest: "{{ cldr_st_path }}/README.md" + src: templates/st-readme.j2 + force: yes # want this to reflect the latest + owner: "{{ cldr_openliberty_user }}" + group: "{{ cldr_openliberty_group }}" + mode: "0644" - name: Create cldr.properties template: dest: "{{ cldr_path }}/cldr.properties" src: templates/cldr-properties.j2 force: no - owner: "{{ cldr_tomcat_user }}" - group: "{{ cldr_tomcat_group }}" + owner: "{{ cldr_openliberty_user }}" + group: "{{ cldr_openliberty_group }}" mode: "0644" - notify: Restart Tomcat + notify: Restart OpenLiberty - name: Checkout CLDR trunk become: yes become_user: surveytool @@ -50,7 +58,7 @@ # it with history. It does not include LFS as that # is not needed for the surveytool. handlers: - - name: Restart Tomcat + - name: Restart OpenLiberty service: - name: "{{ cldr_tomcat_service }}" + name: "{{ cldr_openliberty_service }}" state: restarted diff --git a/tools/scripts/ansible/nginx-playbook.yml b/tools/scripts/ansible/nginx-playbook.yml index 5d3bcf1771b..e2eca4ddd8d 100644 --- a/tools/scripts/ansible/nginx-playbook.yml +++ b/tools/scripts/ansible/nginx-playbook.yml @@ -17,7 +17,15 @@ location /cldr-apps/ { rewrite ^/(.+)\._[\da-f]+_\.(js|css)$ /$1.$2 break; allow all; - proxy_pass http://localhost:8080/cldr-apps/; + proxy_pass http://localhost:9080/cldr-apps/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $remote_addr; + } + location /openapi/ { + rewrite ^/(.+)\._[\da-f]+_\.(js|css)$ /$1.$2 break; + allow all; + proxy_pass http://localhost:9080/openapi/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; diff --git a/tools/scripts/ansible/openliberty-playbook.yml b/tools/scripts/ansible/openliberty-playbook.yml new file mode 100644 index 00000000000..f704a3d2656 --- /dev/null +++ b/tools/scripts/ansible/openliberty-playbook.yml @@ -0,0 +1,85 @@ +- hosts: surveytool + become: yes + gather_facts: yes + vars_files: + - vars/main.yml + - vars/openliberty.yml + - local-vars/local.yml + # vars: + # tomcat_address: 127.0.0.1 + # tomcat_instances: + # - name: "tomcat" + roles: + - role: adoptopenjdk_role + - role: openliberty # local version of devopstoolbox.openliberty + tasks: + # we don't want the defaultServer, we are going to install our own + - name: "Disable openliberty@defaultServer" + ansible.builtin.systemd: + name: openliberty@defaultServer + enabled: no + # this is to make sure openliberty@cldr can startup ok. + - name: setup perms on cldr/ + file: + path: /var/lib/openliberty/usr/servers/cldr/ + state: directory + mode: '0770' + owner: "{{ cldr_openliberty_user }}" + group: "{{ cldr_openliberty_group }}" + - name: "Copy defaultServer to cldr if needed" + ansible.builtin.copy: + force: no + remote_src: true + src: /var/lib/openliberty/usr/servers/defaultServer/server.xml + dest: /var/lib/openliberty/usr/servers/cldr/server.xml + owner: "{{ cldr_openliberty_user }}" + group: "{{ cldr_openliberty_group }}" + mode: '0660' + notify: Restart OpenLiberty + - name: set up cldr/server.env + template: + src: templates/server-env.j2 + dest: "/var/lib/openliberty/usr/servers/cldr/server.env" + owner: "{{ cldr_openliberty_user }}" + group: "{{ cldr_openliberty_group }}" + mode: '0640' + notify: Restart OpenLiberty + - name: set up cldr/bootstrap.properties + template: + src: templates/bootstrap-properties.j2 + dest: "/var/lib/openliberty/usr/servers/cldr/bootstrap.properties" + owner: "{{ cldr_openliberty_user }}" + group: "{{ cldr_openliberty_group }}" + mode: '0640' + notify: Restart OpenLiberty + - name: setup perms on cldr/jdbc + file: + path: /var/lib/openliberty/usr/servers/cldr/jdbc/ + state: directory + mode: '0770' + owner: "{{ cldr_openliberty_user }}" + group: "{{ cldr_openliberty_group }}" + - name: setup perms on cldr/apps + file: + path: /var/lib/openliberty/usr/servers/cldr/apps/ + state: directory + mode: '0770' + owner: "{{ cldr_openliberty_user }}" + group: "{{ cldr_openliberty_group }}" + - name: "Enable openliberty@cldr" + ansible.builtin.systemd: + name: openliberty@cldr + enabled: yes # it won't work until it's deployed + handlers: + - name: Restart OpenLiberty + service: + name: "{{ cldr_openliberty_service }}" + state: restarted + # TODO + # - name: Setup deploy-to-tomcat.sh + # template: + # src: templates/deploy-sh.j2 + # dest: /usr/local/bin/deploy-to-tomcat.sh + # owner: root + # group: root + # mode: '0755' diff --git a/tools/scripts/ansible/redact-db-playbook.yml b/tools/scripts/ansible/redact-db-playbook.yml index e933454dc52..4e1845f753e 100644 --- a/tools/scripts/ansible/redact-db-playbook.yml +++ b/tools/scripts/ansible/redact-db-playbook.yml @@ -58,18 +58,18 @@ command: bash /home/cldradmin/fetch-db.sh # noqa 301 become: yes become_user: cldradmin - - name: stop tomcat + - name: stop openliberty become: true service: - name: "{{ cldr_tomcat_service }}" + name: "{{ cldr_openliberty_service }}" state: stopped - name: redact db # This playbook is intended to always make a change. command: bash /home/cldradmin/redact-db.sh # noqa 301 become: yes become_user: cldradmin - - name: restart tomcat + - name: restart openliberty become: true service: - name: "{{ cldr_tomcat_service }}" + name: "{{ cldr_openliberty_service }}" state: restarted diff --git a/tools/scripts/ansible/requirements.yml b/tools/scripts/ansible/requirements.yml index f63167f7f8c..be70b1d5c81 100644 --- a/tools/scripts/ansible/requirements.yml +++ b/tools/scripts/ansible/requirements.yml @@ -4,14 +4,13 @@ version: 2.8.0 - src: derjd.journald version: 0.0.1 -- src: robertdebock.tomcat - version: 4.6.2 -# The following are also required for robertdebock.tomcat -- src: robertdebock.bootstrap - version: 4.3.4 -- src: robertdebock.core_dependencies - version: 1.5.2 -- src: robertdebock.java - version: 3.0.0 -- src: robertdebock.service - version: 2.8.2 + +# for Java +- src: sfuhrm.adoptopenjdk_role + version: 1.0.0 + name: adoptopenjdk_role + +# does not support ubuntu yet +#- src: https://github.com/devopstoolbox/openliberty +# version: ccbd4d65753222d45c0c6a55e166a3417c6739a4 +# name: devopstoolbox.openliberty diff --git a/tools/scripts/ansible/roles/openliberty/.travis.yml b/tools/scripts/ansible/roles/openliberty/.travis.yml new file mode 100644 index 00000000000..36bbf6208cf --- /dev/null +++ b/tools/scripts/ansible/roles/openliberty/.travis.yml @@ -0,0 +1,29 @@ +--- +language: python +python: "2.7" + +# Use the new container infrastructure +sudo: false + +# Install ansible +addons: + apt: + packages: + - python-pip + +install: + # Install ansible + - pip install ansible + + # Check ansible version + - ansible --version + + # Create ansible.cfg with correct roles_path + - printf '[defaults]\nroles_path=../' >ansible.cfg + +script: + # Basic role syntax check + - ansible-playbook tests/test.yml -i tests/inventory --syntax-check + +notifications: + webhooks: https://galaxy.ansible.com/api/v1/notifications/ \ No newline at end of file diff --git a/tools/scripts/ansible/roles/openliberty/README.md b/tools/scripts/ansible/roles/openliberty/README.md new file mode 100644 index 00000000000..225dd44b9fc --- /dev/null +++ b/tools/scripts/ansible/roles/openliberty/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/tools/scripts/ansible/roles/openliberty/defaults/main.yml b/tools/scripts/ansible/roles/openliberty/defaults/main.yml new file mode 100644 index 00000000000..45d1d2afa8d --- /dev/null +++ b/tools/scripts/ansible/roles/openliberty/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for openliberty diff --git a/tools/scripts/ansible/roles/openliberty/handlers/main.yml b/tools/scripts/ansible/roles/openliberty/handlers/main.yml new file mode 100644 index 00000000000..1f61575ba98 --- /dev/null +++ b/tools/scripts/ansible/roles/openliberty/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for openliberty diff --git a/tools/scripts/ansible/roles/openliberty/meta/main.yml b/tools/scripts/ansible/roles/openliberty/meta/main.yml new file mode 100644 index 00000000000..9cead58eb89 --- /dev/null +++ b/tools/scripts/ansible/roles/openliberty/meta/main.yml @@ -0,0 +1,24 @@ +galaxy_info: + author: Steven R. Loomis + description: Ubuntu installer for OpenLiberty + + license: Unicode-DFS-2016 + + min_ansible_version: 2.1 + + platforms: + - name: Ubuntu + versions: + - all + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. diff --git a/tools/scripts/ansible/roles/openliberty/tasks/main.yml b/tools/scripts/ansible/roles/openliberty/tasks/main.yml new file mode 100644 index 00000000000..9371b1bcba2 --- /dev/null +++ b/tools/scripts/ansible/roles/openliberty/tasks/main.yml @@ -0,0 +1,21 @@ +--- +# tasks file for openliberty +# Docs here: https://openliberty.io/blog/2020/04/09/microprofile-3-3-open-liberty-20004.html#yum +- name: Install OpenLiberty GPG key + become: true + ansible.builtin.apt_key: + url: http://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/os-native-packages/public.key + state: present + when: + - ansible_distribution == "Ubuntu" +- name: Add OpenLiberty repo + become: true + ansible.builtin.apt_repository: + repo: deb https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/os-native-packages/deb/ / + state: present + filename: openliberty +- name: Install OpenLiberty packages + become: true + ansible.builtin.apt: + pkg: + - openliberty diff --git a/tools/scripts/ansible/roles/openliberty/tests/inventory b/tools/scripts/ansible/roles/openliberty/tests/inventory new file mode 100644 index 00000000000..878877b0776 --- /dev/null +++ b/tools/scripts/ansible/roles/openliberty/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/tools/scripts/ansible/roles/openliberty/tests/test.yml b/tools/scripts/ansible/roles/openliberty/tests/test.yml new file mode 100644 index 00000000000..ee2ac06c851 --- /dev/null +++ b/tools/scripts/ansible/roles/openliberty/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - openliberty diff --git a/tools/scripts/ansible/roles/openliberty/vars/main.yml b/tools/scripts/ansible/roles/openliberty/vars/main.yml new file mode 100644 index 00000000000..96b1aa506ae --- /dev/null +++ b/tools/scripts/ansible/roles/openliberty/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for openliberty diff --git a/tools/scripts/ansible/server-playbook.yml b/tools/scripts/ansible/server-playbook.yml index 2c854bb812f..56435e139df 100644 --- a/tools/scripts/ansible/server-playbook.yml +++ b/tools/scripts/ansible/server-playbook.yml @@ -15,6 +15,8 @@ user: name: surveytool shell: /bin/bash + groups: + - "{{ cldr_openliberty_group }}" - name: Give access to surveytool user file: path: "{{ cldr_trunk_path }}" diff --git a/tools/scripts/ansible/setup-playbook.yml b/tools/scripts/ansible/setup-playbook.yml index 0d2155bd7ab..49648053ca3 100644 --- a/tools/scripts/ansible/setup-playbook.yml +++ b/tools/scripts/ansible/setup-playbook.yml @@ -1,7 +1,8 @@ +# need group openliberty to exist, so do that first +- import_playbook: openliberty-playbook.yml - import_playbook: server-playbook.yml - import_playbook: mysql-playbook.yml - import_playbook: nginx-playbook.yml -- import_playbook: tomcat-playbook.yml - import_playbook: cldr-apps-playbook.yml - import_playbook: packages-playbook.yml - import_playbook: certbot-playbook.yml diff --git a/tools/scripts/ansible/templates/bootstrap-properties.j2 b/tools/scripts/ansible/templates/bootstrap-properties.j2 new file mode 100644 index 00000000000..575ebd13eb2 --- /dev/null +++ b/tools/scripts/ansible/templates/bootstrap-properties.j2 @@ -0,0 +1,7 @@ +# This is set up and maintained by the Ansible script. +# If you change this file, your changes may be replaced. + +# This is a "new" property which specifies +# the full path to the config dir. +# It requires a code update in CLDRConfigImpl. +org.unicode.cldr.util.CLDRConfigImpl.cldrHome="{{ cldr_path }}" diff --git a/tools/scripts/ansible/templates/context.j2 b/tools/scripts/ansible/templates/context.j2 deleted file mode 100644 index 0c24b5bd04c..00000000000 --- a/tools/scripts/ansible/templates/context.j2 +++ /dev/null @@ -1,16 +0,0 @@ - - -WEB-INF/web.xml -${catalina.base}/conf/web.xml - - - - diff --git a/tools/scripts/ansible/templates/server-env.j2 b/tools/scripts/ansible/templates/server-env.j2 new file mode 100644 index 00000000000..5f7ada42221 --- /dev/null +++ b/tools/scripts/ansible/templates/server-env.j2 @@ -0,0 +1,7 @@ +# This is set up and maintained by the Ansible script. +# If you change this file, your changes may be replaced. +MYSQL_USER=surveytool +MYSQL_PASSWORD={{ mysql_users[0].password }} +MYSQL_DB=cldrdb +WLP_SKIP_MAXPERMSIZE=true +LOG_DIR=/var/log/openliberty/cldr diff --git a/tools/scripts/ansible/templates/server.xml b/tools/scripts/ansible/templates/server.xml deleted file mode 100644 index 2b258463bd8..00000000000 --- a/tools/scripts/ansible/templates/server.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/scripts/ansible/templates/st-readme.j2 b/tools/scripts/ansible/templates/st-readme.j2 new file mode 100644 index 00000000000..aa3688ed778 --- /dev/null +++ b/tools/scripts/ansible/templates/st-readme.j2 @@ -0,0 +1,9 @@ +WHAT IS THIS DIRECTORY +--- + +This directory has the configuration data for the CLDR Survey Tool. + +For more on CLDR: + +- {{ cldr_trunk_path }}: this is a checkout of the CLDR source repo, from +- {{ cldr_path }}: this contains configuration info for the Survey Tool. diff --git a/tools/scripts/ansible/templates/users.j2 b/tools/scripts/ansible/templates/users.j2 deleted file mode 100644 index 11496ebc590..00000000000 --- a/tools/scripts/ansible/templates/users.j2 +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/tools/scripts/ansible/tomcat-playbook.yml b/tools/scripts/ansible/tomcat-playbook.yml deleted file mode 100644 index 3b5213ecd00..00000000000 --- a/tools/scripts/ansible/tomcat-playbook.yml +++ /dev/null @@ -1,51 +0,0 @@ -- hosts: surveytool - become: yes - gather_facts: yes - vars_files: - - vars/main.yml - - vars/tomcat.yml - - local-vars/local.yml - vars: - tomcat_address: 127.0.0.1 - tomcat_instances: - - name: "tomcat" - roles: - - role: robertdebock.java - - role: robertdebock.tomcat - tasks: - - name: Setup Server Context - template: - src: templates/context.j2 - dest: "{{ cldr_tomcat_conf_path }}/context.xml" - owner: root - group: "{{ cldr_tomcat_group }}" - mode: '0640' - notify: Restart Tomcat - - name: Setup Tomcat server.xml - copy: - src: templates/server.xml - dest: "{{ cldr_tomcat_conf_path }}/server.xml" - owner: root - group: "{{ cldr_tomcat_group }}" - mode: '0640' - notify: Restart Tomcat - - name: Setup Server Users - template: - src: templates/users.j2 - dest: "{{ cldr_tomcat_conf_path }}/tomcat-users.xml" - owner: root - group: "{{ cldr_tomcat_group }}" - mode: '0640' - notify: Restart Tomcat - - name: Setup deploy-to-tomcat.sh - template: - src: templates/deploy-sh.j2 - dest: /usr/local/bin/deploy-to-tomcat.sh - owner: root - group: root - mode: '0755' - handlers: - - name: Restart Tomcat - service: - name: "{{ cldr_tomcat_service }}" - state: restarted diff --git a/tools/scripts/ansible/vagrant-playbook.yml b/tools/scripts/ansible/vagrant-playbook.yml index 958b932653b..fea832ac62a 100644 --- a/tools/scripts/ansible/vagrant-playbook.yml +++ b/tools/scripts/ansible/vagrant-playbook.yml @@ -1,2 +1,3 @@ +# the Vagrant playbook is used for testing, see Vagrantfile - import_playbook: setup-playbook.yml # Note: any additional setup specifically for vagrant could be done here, such as adding a self-signed ssl cert diff --git a/tools/scripts/ansible/vars/main.yml b/tools/scripts/ansible/vars/main.yml index 049452afeb0..0fbc5a9ca7c 100644 --- a/tools/scripts/ansible/vars/main.yml +++ b/tools/scripts/ansible/vars/main.yml @@ -5,11 +5,16 @@ cldr_db_backup_host: corp.unicode.org cldr_db_backup_user: cldrbackup cldr_db_backup_destination: "{{ cldr_db_backup_host }}:/home/users/{{ cldr_db_backup_user }}" -cldr_tomcat_service: tomcat -cldr_tomcat_parent: etc -cldr_tomcat_folder: "{{ cldr_tomcat_service }}" -cldr_tomcat_conf_path: "/{{ cldr_tomcat_parent }}/{{ cldr_tomcat_folder }}/conf" -cldr_tomcat_user: "{{ cldr_tomcat_service }}" -cldr_tomcat_group: "{{ cldr_tomcat_user }}" -cldr_path: "/{{ cldr_tomcat_parent }}/{{ cldr_tomcat_folder }}/cldr" -cldr_trunk_path: "{{ cldr_path }}/cldr-trunk" +cldr_openliberty_user: openliberty +cldr_openliberty_group: "{{ cldr_openliberty_user }}" + +# this is the path to the server config +cldr_st_path: /srv/st +cldr_path: "{{ cldr_st_path }}/config" +# this is the path to the CLDR checkout +cldr_trunk_path: "{{ cldr_st_path }}/src/cldr" +cldr_openliberty_service: openliberty@cldr + +# Java +adoptopenjdk_package: adoptopenjdk-11-openj9 +adoptopenjdk_state: present diff --git a/tools/scripts/ansible/vars/openliberty.yml b/tools/scripts/ansible/vars/openliberty.yml new file mode 100644 index 00000000000..f4c8934667d --- /dev/null +++ b/tools/scripts/ansible/vars/openliberty.yml @@ -0,0 +1,10 @@ +# This file contains variables used by devopstoolbox.openliberty for Survey Tool +openliberty_firewall_configure: false +openliberty_packages_state: present +openliberty_remove_packages: true +openliberty_enable_service: false +openliberty_enable_selinux: false +openliberty_copy_templates: false +openliberty_users: + - user: "{{ cldr_openliberty_user }}" + group: "{{ cldr_openliberty_group }}" diff --git a/tools/scripts/ansible/vars/tomcat.yml b/tools/scripts/ansible/vars/tomcat.yml deleted file mode 100644 index 6193c3cc279..00000000000 --- a/tools/scripts/ansible/vars/tomcat.yml +++ /dev/null @@ -1,15 +0,0 @@ -# This file contains variables used by robertdebock.tomcat for Survey Tool -# Reference: https://galaxy.ansible.com/robertdebock/tomcat -tomcat_version9: 9.0.36 -tomcat_version: 9 -tomcat_mirror: "https://archive.apache.org" # where to download Apache Tomcat -tomcat_name: "{{ cldr_tomcat_service }}" -tomcat_directory: "/{{ cldr_tomcat_parent }}" # /etc or /opt; as in /etc/tomcat -tomcat_user: "{{ cldr_tomcat_user }}" -tomcat_group: "{{ cldr_tomcat_group }}" - -tomcat_instances: - - name: "{{ tomcat_name }}" - version: "{{ tomcat_version }}" - user: "{{ tomcat_user }}" - group: "{{ tomcat_group }}"