diff --git a/jobs/pipelines/swarm-deploy-cicd.groovy b/jobs/pipelines/swarm-deploy-cicd.groovy
index 0183016..dd2df11 100644
--- a/jobs/pipelines/swarm-deploy-cicd.groovy
+++ b/jobs/pipelines/swarm-deploy-cicd.groovy
@@ -52,6 +52,12 @@
                 stage("Run Jenkins job on salt-master [deploy_openstack:${env.STACK_INSTALL}]") {
                     shared.run_job_on_day01_node(env.STACK_INSTALL, install_timeout)
                 }
+                stage("Create env_jenkins_cicd and env_k8s files") {
+                    shared.run_cmd("""\
+                        export TESTS_CONFIGS=\$(pwd)/${ENV_NAME}_salt_deployed.ini
+                        python ./tcp_tests/utils/create_env_jenkins_cicd.py
+                    """)
+                }
 
                 for (stack in "${env.STACK_INSTALL}".split(",")) {
                     stage("Sanity check the deployed component [${stack}]") {
diff --git a/tcp_tests/managers/saltmanager.py b/tcp_tests/managers/saltmanager.py
index 737edcd..a33bb11 100644
--- a/tcp_tests/managers/saltmanager.py
+++ b/tcp_tests/managers/saltmanager.py
@@ -14,7 +14,6 @@
 
 import netaddr
 import pkg_resources
-import yaml
 
 from collections import defaultdict
 
@@ -64,8 +63,8 @@
                               label="Install and configure salt")
         self.create_env_salt()
         self.create_env_jenkins_day01()
-        self.create_env_jenkins_cicd()
-        self.create_env_k8s()
+        # self.create_env_jenkins_cicd()
+        # self.create_env_k8s()
 
     def change_creds(self, username, password):
         self.__user = username
@@ -371,34 +370,21 @@
 
         env_jenkins_cicd_filename = pkg_resources.resource_filename(
             settings.__name__, 'utils/env_jenkins_cicd')
-        domain_name = self.get_single_pillar(
-            tgt="I@salt:master", pillar="_param:cluster_domain")
-        LOG.info("Domain: {}".format(domain_name))
-        cid01 = 'cid01.' + domain_name
-        LOG.info("{}".format(cid01))
-        command = "reclass -n {}".format(cid01)
-        LOG.info("{}".format(command))
-        cfg = self.__underlay.get_target_node_names('cfg01')[0]
-        LOG.info("cfg node_name: {}".format(cfg))
-        output = self.__underlay.check_call(
-            node_name=cfg,
-            cmd=command)
-        result = yaml.load(output.stdout_str)
-        jenkins_params = result.get(
-            'parameters', {}).get(
-            'jenkins', {}).get(
-            'client', {}).get(
-            'master', {})
-        if not jenkins_params:
+
+        tgt = 'I@docker:client:stack:jenkins and cid01*'
+        try:
+            jenkins_params = self.get_single_pillar(
+                tgt=tgt, pillar="jenkins:client:master")
+        except LookupError as e:
+            LOG.error("Skipping creation {0} because cannot get Jenkins CICD "
+                      "parameters from '{1}': {2}"
+                      .format(env_jenkins_cicd_filename, tgt, e.message))
             return
+
         jenkins_host = jenkins_params['host']
-        LOG.info("jenkins_host: {}".format(jenkins_host))
         jenkins_port = jenkins_params['port']
-        LOG.info("jenkins_port: {}".format(jenkins_port))
         jenkins_user = jenkins_params['username']
-        LOG.info("jenkins_user: {}".format(jenkins_user))
         jenkins_pass = jenkins_params['password']
-        LOG.info("jenkins_pass: {}".format(jenkins_pass))
 
         with open(env_jenkins_cicd_filename, 'w') as f:
             f.write(
@@ -426,46 +412,23 @@
 
         env_k8s_filename = pkg_resources.resource_filename(
             settings.__name__, 'utils/env_k8s')
-        domain_name = self.get_single_pillar(
-            tgt="I@salt:master", pillar="_param:cluster_domain")
-        LOG.info("Domain: {}".format(domain_name))
-        ctl01 = 'ctl01.' + domain_name
-        LOG.info("{}".format(ctl01))
-        command = "reclass -n {}".format(ctl01)
-        LOG.info("{}".format(command))
-        cfg = self.__underlay.get_target_node_names('cfg01')[0]
-        LOG.info("cfg node_name: {}".format(cfg))
-        output = self.__underlay.check_call(
-            node_name=cfg,
-            cmd=command)
-        result = yaml.load(output.stdout_str)
-        haproxy_params = result.get(
-            'parameters', {}).get(
-            'haproxy', {}).get(
-            'proxy', {}).get(
-            'listen', {}).get(
-            'k8s_secure', {}).get(
-            'binds', {})
-        if not haproxy_params:
+
+        tgt = 'I@haproxy:proxy:enabled:true and I@kubernetes:master and *01*'
+        try:
+            haproxy_params = self.get_single_pillar(
+                tgt=tgt, pillar="haproxy:proxy:listen:k8s_secure:binds")[0]
+            k8s_params = self.get_single_pillar(
+                tgt=tgt, pillar="kubernetes:master:admin")
+        except LookupError as e:
+            LOG.error("Skipping creation {0} because cannot get Kubernetes "
+                      "parameters from '{1}': {2}"
+                      .format(env_k8s_filename, tgt, e.message))
             return
-        k8s_params = result.get(
-            'kubernetes', {}).get(
-            'master', {}).get(
-            'admin', {})
-        if not k8s_params:
-            return
+
         kube_host = haproxy_params['address']
-        LOG.info("kube_host: {}".
-                 format(kube_host))
         kube_apiserver_port = haproxy_params['port']
-        LOG.info("kube_apiserver_port: {}".
-                 format(kube_apiserver_port))
         kubernetes_admin_user = k8s_params['username']
-        LOG.info("kubernetes_admin_user: {}".
-                 format(kubernetes_admin_user))
         kubernetes_admin_password = k8s_params['password']
-        LOG.info("kubernetes_admin_password: {}".
-                 format(kubernetes_admin_password))
 
         with open(env_k8s_filename, 'w') as f:
             f.write(
diff --git a/tcp_tests/utils/create_env_jenkins_cicd.py b/tcp_tests/utils/create_env_jenkins_cicd.py
new file mode 100644
index 0000000..ba73d6c
--- /dev/null
+++ b/tcp_tests/utils/create_env_jenkins_cicd.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+sys.path.append(os.getcwd())
+try:
+    from tcp_tests.fixtures import config_fixtures
+    from tcp_tests.managers import underlay_ssh_manager
+    from tcp_tests.managers import saltmanager as salt_manager
+except ImportError:
+    print("ImportError: Run the application from the tcp-qa directory or "
+          "set the PYTHONPATH environment variable to directory which contains"
+          " ./tcp_tests")
+    sys.exit(1)
+
+
+def main():
+    tests_configs = os.environ.get('TESTS_CONFIGS', None)
+    if not tests_configs or not os.path.isfile(tests_configs):
+        print("Please set TESTS_CONFIGS environment variable whith"
+              "the path to INI file with lab metadata.")
+        return 1
+    config = config_fixtures.config()
+    underlay = underlay_ssh_manager.UnderlaySSHManager(config)
+    saltmanager = salt_manager.SaltManager(config, underlay)
+    saltmanager.create_env_jenkins_cicd()
+    saltmanager.create_env_k8s()
+
+
+if __name__ == '__main__':
+    sys.exit(main())
