Switch salt-formulas repository to mirror.mirantis.com
- Set MCP_SALT_REPO_URL and MCP_SALT_REPO_KEY in the user-data
for cfg01 node *only* if the values are non-empty.
If values are empty, defaults from mcp-common-scripts will be used.
- Fix the URLs in the shared-salt.yaml to use mirror.mirantis.com
- Cleanup the cookied-model-generator from unused values
Change-Id: I1582f82aa4755f0b11de747b54fa6977eeb78d5b
diff --git a/jobs/pipelines/swarm-bootstrap-salt-cluster-devops.groovy b/jobs/pipelines/swarm-bootstrap-salt-cluster-devops.groovy
index 7b2ff15..998d55b 100644
--- a/jobs/pipelines/swarm-bootstrap-salt-cluster-devops.groovy
+++ b/jobs/pipelines/swarm-bootstrap-salt-cluster-devops.groovy
@@ -19,6 +19,10 @@
* COOKIECUTTER_TEMPLATE_COMMIT Commit/tag/branch for cookiecutter-templates repository. If empty, then takes ${MCP_VERSION} value
* SALT_MODELS_SYSTEM_COMMIT Commit/tag/branch for reclass-system repository. If empty, then takes ${MCP_VERSION} value
* SHUTDOWN_ENV_ON_TEARDOWN optional, shutdown fuel-devops environment at the end of the job
+ * MCP_SALT_REPO_URL Base URL for MCP repositories required to bootstrap cfg01 node. Leave blank to use default
+ * (http://mirror.mirantis.com/ from mcp-common-scripts)
+ * MCP_SALT_REPO_KEY URL of the key file. Leave blank to use default
+ * (${MCP_SALT_REPO_URL}/${MCP_VERSION}/salt-formulas/xenial/archive-salt-formulas.key from mcp-common-scripts)
*
*/
diff --git a/jobs/pipelines/swarm-create-cfg-config-drive.groovy b/jobs/pipelines/swarm-create-cfg-config-drive.groovy
index 72d278f..46d5010 100644
--- a/jobs/pipelines/swarm-create-cfg-config-drive.groovy
+++ b/jobs/pipelines/swarm-create-cfg-config-drive.groovy
@@ -152,7 +152,10 @@
stage("Set data"){
for (i in entries(smc)) {
- sh "sed -i \"s,export ${i[0]}=.*,export ${i[0]}=${i[1]},\" ${user_data_script_path}"
+ // Replace only if the variable is non-empty, leave default otherwise
+ if (i[1]) {
+ sh "sed -i \"s,export ${i[0]}=.*,export ${i[0]}=${i[1]},\" ${user_data_script_path}"
+ }
}
}