Check if all services are running
Change-Id: I045a7eadf5970060b420dd0b79f2d224dce64d64
diff --git a/cicd-lab-pipeline.groovy b/cicd-lab-pipeline.groovy
index b742e04..08b7527 100644
--- a/cicd-lab-pipeline.groovy
+++ b/cicd-lab-pipeline.groovy
@@ -244,6 +244,12 @@
}
salt.enforceState(saltMaster, 'I@nginx:server', 'nginx')
+ def failedSvc = salt.cmdRun(saltMaster, '*', """systemctl --failed | grep -E 'loaded[ \t]+failed' && echo 'Command execution failed'""")
+ print failedSvc
+ if (failedSvc =~ /Command execution failed/) {
+ common.errorMsg("Some services are not running. Environment may not be fully functional!")
+ }
+
common.successMsg("""
============================================================
Your CI/CD lab has been deployed and you can enjoy it: