Merge "Remove syntax check from test-salt-formula-env"
diff --git a/cloud-deploy-pipeline.groovy b/cloud-deploy-pipeline.groovy
index 8dccccb..6cc6fbd 100644
--- a/cloud-deploy-pipeline.groovy
+++ b/cloud-deploy-pipeline.groovy
@@ -204,13 +204,14 @@
 
                 // get outputs
                 saltMasterHost = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'SaltMasterIP')
+                awsLoadBalancer = aws.getOutputs(venv, aws_env_vars, STACK_NAME, 'ControlLoadBalancer')
                 // check that saltMasterHost is valid
                 if (!saltMasterHost || !saltMasterHost.matches(ipRegex)) {
                     common.errorMsg("saltMasterHost is not a valid ip, value is: ${saltMasterHost}")
                     throw new Exception("saltMasterHost is not a valid ip")
                 }
 
-                currentBuild.description = "${STACK_NAME} ${saltMasterHost}"
+                currentBuild.description = "Stack name: ${STACK_NAME}, Salt API: http://${saltMasterHost}:6969, k8s API: https://${awsLoadBalancer}"
                 SALT_MASTER_URL = "http://${saltMasterHost}:6969"
 
             } else if (STACK_TYPE != 'physical') {
@@ -288,8 +289,11 @@
             }
 
             stage('Install Kubernetes control') {
-
                 orchestrate.installKubernetesControl(saltMaster)
+
+                // collect artifacts (kubeconfig)
+                writeFile(file: 'kubeconfig', text: salt.getFileContent(saltMaster, 'I@kubernetes:master and *01*', '/etc/kubernetes/admin-kube-config'))
+                archiveArtifacts(artifacts: 'kubeconfig')
             }
 
             stage('Scale Kubernetes computes') {
diff --git a/generate-cookiecutter-products.groovy b/generate-cookiecutter-products.groovy
index 2b5c4ef..926e2ac 100644
--- a/generate-cookiecutter-products.groovy
+++ b/generate-cookiecutter-products.groovy
@@ -162,23 +162,26 @@
 
             // create config-drive
             sh "./create-config-drive --user-data user_data.sh --hostname cfg --model ${modelEnv} cfg.${clusterDomain}-config.iso"
-
+            sh("mkdir output-${clusterName} && mv cfg.${clusterDomain}-config.iso output-${clusterName}/")
             // save iso to artifacts
-            archiveArtifacts artifacts: "cfg.${clusterDomain}-config.iso"
+            archiveArtifacts artifacts: "output-${clusterName}/cfg.${clusterDomain}-config.iso"
         }
 
         stage ('Save changes reclass model') {
 
-            sh(returnStatus: true, script: "tar -zcf ${clusterName}.tar.gz -C ${modelEnv} .")
-            archiveArtifacts artifacts: "${clusterName}.tar.gz"
+            sh(returnStatus: true, script: "tar -zcf output-${clusterName}/${clusterName}.tar.gz -C ${modelEnv} .")
+            archiveArtifacts artifacts: "output-${clusterName}/${clusterName}.tar.gz"
 
 
             if (EMAIL_ADDRESS != null && EMAIL_ADDRESS != "") {
                  emailext(to: EMAIL_ADDRESS,
-                          attachmentsPattern: "${clusterName}.tar.gz",
+                          attachmentsPattern: "output-${clusterName}/*",
                           body: "Mirantis Jenkins\n\nRequested reclass model ${clusterName} has been created and attached to this email.\nEnjoy!\n\nMirantis",
                           subject: "Your Salt model ${clusterName}")
             }
+            dir("output-${clusterName}"){
+                deleteDir()
+            }
         }
 
     } catch (Throwable e) {
@@ -193,4 +196,4 @@
         }
          // common.sendNotification(currentBuild.result,"",["slack"])
     }
-}
+}
\ No newline at end of file