diff --git a/vars/rpmDashboardsDistValidation.groovy b/vars/rpmDashboardsDistValidation.groovy index 73c8f7de5..f4215a3c3 100644 --- a/vars/rpmDashboardsDistValidation.groovy +++ b/vars/rpmDashboardsDistValidation.groovy @@ -78,18 +78,22 @@ def call(Map args = [:]) { error("Something went run! Installed $name is not actively running.") } + def versionNumbers = version.split('\\.')*.toInteger() + + def adminPassword = versionNumbers[0] > 2 || (versionNumbers[0] == 2 && versionNumbers[1] >= 12) ? "myStrongPassword123!" : "admin" + // Get the OpenSearch-Dashboards api status after start. def osd_status_json = -1 for (int i = 0; i < 10; i++) { if (osd_status_json != 0) { sleep 10 osd_status_json = sh ( - script: "curl -s \"http://localhost:5601/api/status\" -u admin:admin", + script: "curl -s \"http://localhost:5601/api/status\" -u admin:${adminPassword}", returnStatus: true ) } else { osd_status_json = sh ( - script: "curl -s \"http://localhost:5601/api/status\" -u admin:admin", + script: "curl -s \"http://localhost:5601/api/status\" -u admin:${adminPassword}", returnStdout: true ).trim() break diff --git a/vars/rpmOpenSearchDistValidation.groovy b/vars/rpmOpenSearchDistValidation.groovy index 6d132d416..b2fde3bd4 100644 --- a/vars/rpmOpenSearchDistValidation.groovy +++ b/vars/rpmOpenSearchDistValidation.groovy @@ -46,7 +46,7 @@ def call(Map args = [:]) { //Install OpenSearch with designated version via yum println("Start installation with yum.") rpmCommands( - command: "install", + command: "sudo env OPENSEARCH_INITIAL_ADMIN_PASSWORD=myStrongPassword123! install", product: "$name-$rpmVersion" ) println("RPM distribution for $name is installed with yum.") @@ -101,9 +101,13 @@ def call(Map args = [:]) { error("Something went wrong! Installed $name is not actively running.") } + def versionNumbers = version.split('\\.')*.toInteger() + + def adminPassword = versionNumbers[0] > 2 || (versionNumbers[0] == 2 && versionNumbers[1] >= 12) ? "myStrongPassword123!" : "admin" + //Check the starting cluster def cluster_info_json = sh ( - script: "curl -s \"https://localhost:9200\" -u admin:admin --insecure", + script: "curl -s \"https://localhost:9200\" -u admin:${adminPassword} --insecure", returnStdout: true ).trim() println("Cluster info is: \n" + cluster_info_json)