diff --git a/tcp_tests/helpers/oslo_cfg_types.py b/tcp_tests/helpers/oslo_cfg_types.py
index 8b322b7..0430076 100644
--- a/tcp_tests/helpers/oslo_cfg_types.py
+++ b/tcp_tests/helpers/oslo_cfg_types.py
@@ -102,15 +102,31 @@
     """
     def __init__(self, *args, **kwargs):
 
-        env_var_name = args[0].upper()
-        if 'default' in kwargs:
-            # Load a default environment variable with expected type
-            kwargs['default'] = args[1](
-                os.environ.get(env_var_name, kwargs.get('default', None))
-            )
+        # if 'default' in kwargs:
+        #    # Load a default environment variable with expected type
+        #    kwargs['default'] = args[1](
+        #        os.environ.get(env_var_name, kwargs.get('default', None))
+        #    )
+
         super(Cfg, self).__init__(*args, **kwargs)
 
+        env_var_name = args[0].upper()
+        if env_var_name not in os.environ:
+            env_var_name = args[0]
+        if env_var_name in os.environ:
+            self.environment_value = self.type(os.environ.get(env_var_name))
+            print('{}={}  # {}'.format(env_var_name,
+                                       self.environment_value,
+                                       kwargs.get('help', '')))
+
         # Print info about default environment variables to console
-        print('{}={}  # {}'.format(env_var_name,
-                                   kwargs.get('default', ''),
-                                   kwargs.get('help', '')))
+        # print('{}={}  # {}'.format(env_var_name,
+        #                           kwargs.get('default', ''),
+        #                           kwargs.get('help', '')))
+
+    def _get_from_namespace(self, namespace, group_name):
+        res = super(Cfg, self)._get_from_namespace(namespace, group_name)
+        # Use the value from enviroment variable instead of config
+        if hasattr(self, 'environment_value'):
+            res = (self.environment_value, res[1])
+        return res
diff --git a/tcp_tests/managers/envmanager_devops.py b/tcp_tests/managers/envmanager_devops.py
index d17c6bd..d02cff5 100644
--- a/tcp_tests/managers/envmanager_devops.py
+++ b/tcp_tests/managers/envmanager_devops.py
@@ -307,29 +307,58 @@
             raise exceptions.EnvironmentIsNotSet()
         self.__env.start()
         LOG.info('Environment "{0}" started'.format(self.__env.name))
+        check_cloudinit_started = '[ -f /is_cloud_init_started ]'
+        check_cloudinit_finished = '[ -f /is_cloud_init_finished ]'
+        passed = {}
         for node in self.__env.get_nodes(role__in=underlay_node_roles):
             LOG.info("Waiting for SSH on node '{0}' / {1} ...".format(
                 node.name, self.node_ip(node)))
 
-            def _ssh_wait(host,
-                          port,
-                          username=settings.SSH_NODE_CREDENTIALS['login'],
-                          password=settings.SSH_NODE_CREDENTIALS['password'],
-                          timeout=0):
+            def _ssh_check(host,
+                           port,
+                           username=settings.SSH_NODE_CREDENTIALS['login'],
+                           password=settings.SSH_NODE_CREDENTIALS['password'],
+                           timeout=0):
                 try:
                     ssh = ssh_client.SSHClient(
                         host=host, port=port,
                         auth=ssh_client.SSHAuth(
                             username=username,
                             password=password))
-                except AuthenticationException:
-                    return True
-                except BadAuthenticationType:
+
+                    # If '/is_cloud_init_started' exists, then wait for
+                    # the flag /is_cloud_init_finished
+                    if ssh.execute(check_cloudinit_started)['exit_code'] == 0:
+                        status = ssh.execute(
+                            check_cloudinit_finished)['exit_code'] == 0
+                    # Else, just wait for SSH
+                    else:
+                        status = ssh.execute('echo ok')['exit_code'] == 0
+                    return status
+
+                except (AuthenticationException, BadAuthenticationType):
                     return True
                 except Exception:
                     return False
 
-                return ssh.execute('echo ok')['exit_code'] == 0
+            def _ssh_wait(host,
+                          port,
+                          username=settings.SSH_NODE_CREDENTIALS['login'],
+                          password=settings.SSH_NODE_CREDENTIALS['password'],
+                          timeout=0):
+
+                if host in passed and passed[host] >= 2:
+                    # host already passed the check
+                    return True
+
+                for node in self.__env.get_nodes(role__in=underlay_node_roles):
+                    ip = self.node_ip(node)
+                    if ip not in passed:
+                        passed[ip] = 0
+                    if _ssh_check(ip, port):
+                        passed[ip] += 1
+                    else:
+                        passed[ip] = 0
 
             helpers.wait(
                 lambda: _ssh_wait(self.node_ip(node), 22),
diff --git a/tcp_tests/managers/jenkins/client.py b/tcp_tests/managers/jenkins/client.py
index 0b0d7de..2628e7a 100644
--- a/tcp_tests/managers/jenkins/client.py
+++ b/tcp_tests/managers/jenkins/client.py
@@ -1,4 +1,5 @@
 from __future__ import print_function
+import time
 
 import jenkins
 import requests
@@ -6,13 +7,40 @@
 from devops.helpers import helpers
 
 
+class JenkinsWrapper(jenkins.Jenkins):
+    """Workaround for the bug:
+       https://bugs.launchpad.net/python-jenkins/+bug/1775047
+    """
+    def _response_handler(self, response):
+        '''Handle response objects'''
+
+        # raise exceptions if occurred
+        response.raise_for_status()
+
+        headers = response.headers
+        if (headers.get('content-length') is None and
+                headers.get('transfer-encoding') is None and
+                (response.status_code == 201 and
+                 headers.get('location') is None) and
+                (response.content is None or len(response.content) <= 0)):
+            # response body should only exist if one of these is provided
+            raise jenkins.EmptyResponseException(
+                "Error communicating with server[%s]: "
+                "empty response" % self.server)
+
+        # Response objects will automatically return unicode encoded
+        # when accessing .text property
+        return response
+
+
 class JenkinsClient(object):
 
     def __init__(self, host=None, username=None, password=None):
         host = host or 'http://172.16.44.33:8081'
         username = username or 'admin'
         password = password or 'r00tme'
-        self.__client = jenkins.Jenkins(
+        # self.__client = jenkins.Jenkins(
+        self.__client = JenkinsWrapper(
             host,
             username=username,
             password=password)
@@ -50,62 +78,92 @@
     def run_build(self, name, params=None, timeout=600, verbose=False):
         params = params or self.make_defults_params(name)
         num = self.__client.build_job(name, params)
+        time.sleep(2)  # wait while job is started
 
         def is_blocked():
             queued = self.__client.get_queue_item(num)
             status = not queued['blocked']
             if not status and verbose:
                 print("pending the job [{}] : {}".format(name, queued['why']))
-            return status
+            return (status and
+                    'executable' in (queued or {}) and
+                    'number' in (queued['executable'] or {}))
 
         helpers.wait(
             is_blocked,
             timeout=timeout,
             interval=30,
             timeout_msg='Timeout waiting to run the job [{}]'.format(name))
-
         build_id = self.__client.get_queue_item(num)['executable']['number']
         return name, build_id
 
-    def wait_end_of_build(self, name, build_id, timeout=600,
-                          verbose=False):
+    def wait_end_of_build(self, name, build_id, timeout=600, interval=5,
+                          verbose=False, job_output_prefix=''):
+        '''Wait until the specified build is finished
+
+        :param name: ``str``, job name
+        :param build_id: ``int``, build id
+        :param timeout: ``int``, timeout waiting the job, sec
+        :param interval: ``int``, interval of polling the job result, sec
+        :param verbose: ``bool``, print the job console updates during waiting
+        :param job_output_prefix: ``str``, print the prefix for each console
+                                  output line, with the pre-defined
+                                  substitution keys:
+                                  - '{name}' : the current job name
+                                  - '{build_id}' : the current build-id
+                                  - '{time}' : the current time
+        :returns: requests object with headers and console output,  ``obj``
+        '''
         start = [0]
+        time_str = time.strftime("%H:%M:%S")
+        prefix = "\n" + job_output_prefix.format(job_name=name,
+                                                 build_number=build_id,
+                                                 time=time_str)
+        if verbose:
+            print(prefix, end='')
 
         def building():
             status = not self.build_info(name, build_id)['building']
             if verbose:
+                time_str = time.strftime("%H:%M:%S")
+                prefix = "\n" + job_output_prefix.format(
+                    job_name=name, build_number=build_id, time=time_str)
                 res = self.get_progressive_build_output(name,
                                                         build_id,
                                                         start=start[0])
                 if 'X-Text-Size' in res.headers:
                     text_size = int(res.headers['X-Text-Size'])
                     if start[0] < text_size:
-                        print(res.content, end='')
+                        text = res.content.decode('utf-8',
+                                                  errors='backslashreplace')
+                        print(text.replace("\n", prefix), end='')
                         start[0] = text_size
             return status
 
         helpers.wait(
             building,
             timeout=timeout,
+            interval=interval,
             timeout_msg='Timeout waiting, job {0} are not finished "{1}" build'
                         ' still'.format(name, build_id))
 
     def get_build_output(self, name, build_id):
         return self.__client.get_build_console_output(name, build_id)
 
-    def get_progressive_build_output(self, name, build_id, start=0,
-                                     raise_on_err=False):
+    def get_progressive_build_output(self, name, build_id, start=0):
         '''Get build console text.
 
         :param name: Job name, ``str``
-        :param name: Build id, ``int``
-        :param name: Start offset, ``int``
+        :param build_id: Build id, ``int``
+        :param start: Start offset, ``int``
         :returns: requests object with headers and console output,  ``obj``
         '''
         folder_url, short_name = self.__client._get_job_folder(name)
 
         PROGRESSIVE_CONSOLE_OUTPUT = (
             '%(folder_url)sjob/%(short_name)s/%(build_id)d/'
-            'logText/progressiveHtml?start=%(start)d')
-        url = self.__client._build_url(PROGRESSIVE_CONSOLE_OUTPUT, locals())
-        return(requests.get(url))
+            'logText/progressiveText?start=%(start)d')
+        req = requests.Request(
+                'GET',
+                self.__client._build_url(PROGRESSIVE_CONSOLE_OUTPUT, locals()))
+        return(self.__client.jenkins_request(req))
diff --git a/tcp_tests/managers/underlay_ssh_manager.py b/tcp_tests/managers/underlay_ssh_manager.py
index 44c8830..495e51d 100644
--- a/tcp_tests/managers/underlay_ssh_manager.py
+++ b/tcp_tests/managers/underlay_ssh_manager.py
@@ -357,7 +357,7 @@
         """
         remote = self.remote(node_name=node_name, host=host,
                              address_pool=address_pool)
-        with remote.get_sudo(remote):
+        with remote.sudo(enforce=True):
             return remote.check_call(
                 command=cmd, verbose=verbose, timeout=timeout,
                 error_info=error_info, expected=expected,
diff --git a/tcp_tests/utils/__init__.py b/tcp_tests/utils/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tcp_tests/utils/__init__.py
diff --git a/tcp_tests/utils/create_devops_env.py b/tcp_tests/utils/create_devops_env.py
new file mode 100755
index 0000000..d7c062c
--- /dev/null
+++ b/tcp_tests/utils/create_devops_env.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+sys.path.append(os.getcwd())
+try:
+    from tcp_tests.helpers import ext
+    from tcp_tests.fixtures import config_fixtures
+    from tcp_tests.managers import envmanager_devops
+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():
+    """Create fuel-devops environment from template"""
+    config = config_fixtures.config()
+    env = envmanager_devops.EnvironmentManager(config=config)
+    if not env.has_snapshot(ext.SNAPSHOT.hardware):
+        env.create_snapshot(ext.SNAPSHOT.hardware)
+
+
+if __name__ == '__main__':
+    sys.exit(main())
diff --git a/tcp_tests/utils/env_jenkins_cicd b/tcp_tests/utils/env_jenkins_cicd
new file mode 100755
index 0000000..04cdd56
--- /dev/null
+++ b/tcp_tests/utils/env_jenkins_cicd
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# Source file to set access credentials to Jenkins API on CICD cluster
+# Requires parameters to work with libpepper:
+#  - SALTAPI_URL
+#  - SALTAPI_USER
+#  - SALTAPI_PASS
+# Example usage:
+# $> export ENV_NAME=some-test-environment
+# $> . ./tcp_tests/utils/env_salt
+# $> . ./tcp_tests/utils/env_jenkins_cicd
+# $> ./tcp_tests/utils/run_jenkins_job.py --verbose --job-name=deploy_openstack --job-parameters="{... json ...}"
+
+CURRENT_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
+export PYTHONPATH="${CURRENT_DIR}/../.."
+
+if [ -z "$SALTAPI_URL" ]; then
+    echo "$SALTAPI_URL not found in the environment variables, getting values from salt-master is impossible."
+    unset JENKINS_URL
+    unset JENKINS_USER
+    unset JENKINS_PASS
+    unset JENKINS_START_TIMEOUT
+    unset JENKINS_BUILD_TIMEOUT
+else
+    MASTER="get_param.py -C I@docker:client:stack:jenkins pillar.get jenkins:client:master"
+    export JENKINS_HOST=$(${CURRENT_DIR}/${MASTER}:host)
+    export JENKINS_PORT=$(${CURRENT_DIR}/${MASTER}:port)
+    export JENKINS_URL=http://${JENKINS_HOST}:${JENKINS_PORT}
+    export JENKINS_USER=$(${CURRENT_DIR}/${MASTER}:username)
+    export JENKINS_PASS=$(${CURRENT_DIR}/${MASTER}:password)
+    export JENKINS_START_TIMEOUT=60
+    export JENKINS_BUILD_TIMEOUT=1800
+fi
+
+echo "export JENKINS_URL='$JENKINS_URL'  # Jenkins API URL"
+echo "export JENKINS_USER='${JENKINS_USER}'  # Jenkins API username"
+echo "export JENKINS_PASS='${JENKINS_PASS}'  # Jenkins API password or token"
+echo "export JENKINS_START_TIMEOUT='${JENKINS_START_TIMEOUT}'  # Timeout waiting for job in queue to start building"
+echo "export JENKINS_BUILD_TIMEOUT='${JENKINS_BUILD_TIMEOUT}'  # Timeout waiting for building job to complete"
diff --git a/tcp_tests/utils/env_jenkins_day01 b/tcp_tests/utils/env_jenkins_day01
new file mode 100755
index 0000000..c084a52
--- /dev/null
+++ b/tcp_tests/utils/env_jenkins_day01
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# Source file to set access credentials to Jenkins API on salt-master node (day01 deployment steps)
+# Requires:
+#  - ENV_NAME
+# Example usage:
+# $> . ./tcp_tests/utils/env_salt
+# $> . ./tcp_tests/utils/env_jenkins_day01
+# $> ./tcp_tests/utils/run_jenkins_job.py --verbose --job-name=deploy_openstack --job-parameters="{... json ...}"
+
+CURRENT_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
+export PYTHONPATH=${CURRENT_DIR}/../..
+
+SALT_MASTER_IP=${SALT_MASTER_IP:-$(for node in $(dos.py slave-ip-list --address-pool-name admin-pool01 ${ENV_NAME}); do echo $node|grep cfg01|cut -d',' -f2; done)}
+
+if [ -z "$SALT_MASTER_IP" ]; then
+    echo "SALT_MASTER_IP not found in the environment '${ENV_NAME}'"
+    unset JENKINS_URL
+    unset JENKINS_USER
+    unset JENKINS_PASS
+    unset JENKINS_START_TIMEOUT
+    unset JENKINS_BUILD_TIMEOUT
+else
+    # For run_jenkins_job.py
+    export JENKINS_URL=http://${SALT_MASTER_IP}:8081
+    export JENKINS_USER=admin
+    export JENKINS_PASS=r00tme
+    export JENKINS_START_TIMEOUT=60
+    export JENKINS_BUILD_TIMEOUT=1800
+fi
+
+echo "export JENKINS_URL='$JENKINS_URL'  # Jenkins API URL"
+echo "export JENKINS_USER='${JENKINS_USER}'  # Jenkins API username"
+echo "export JENKINS_PASS='${JENKINS_PASS}'  # Jenkins API password or token"
+echo "export JENKINS_START_TIMEOUT='${JENKINS_START_TIMEOUT}'  # Timeout waiting for job in queue to start building"
+echo "export JENKINS_BUILD_TIMEOUT='${JENKINS_BUILD_TIMEOUT}'  # Timeout waiting for building job to complete"
diff --git a/tcp_tests/utils/env_k8s b/tcp_tests/utils/env_k8s
new file mode 100755
index 0000000..01e20fd
--- /dev/null
+++ b/tcp_tests/utils/env_k8s
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# Source file to set access credentials to Kubernetes API
+# Requires parameters to work with libpepper:
+#  - SALTAPI_URL
+#  - SALTAPI_USER
+#  - SALTAPI_PASS
+# Example usage:
+# $> export ENV_NAME=some-test-environment
+# $> . ./tcp_tests/utils/env_salt
+# $> . ./tcp_tests/utils/env_k8s
+# # now you can run tcp-qa test cases for k8s
+
+CURRENT_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
+export PYTHONPATH=${CURRENT_DIR}/../..
+
+if [ -z "$SALTAPI_URL" ]; then
+    echo "$SALTAPI_URL not found in the environment variables, getting values from salt-master is impossible."
+    unset kube_host
+    unset kube_apiserver_port
+    unset kubernetes_admin_user
+    unset kubernetes_admin_password
+else
+    KUBE_TARGET='I@haproxy:proxy:enabled:true and I@kubernetes:master and *01*'
+    export kube_host=$(${PYTHONPATH}/tcp_tests/utils/get_param.py -C "${KUBE_TARGET}" pillar.get haproxy:proxy:listen:k8s_secure:binds:address)
+    export kube_apiserver_port=$(${PYTHONPATH}/tcp_tests/utils/get_param.py -C "${KUBE_TARGET}" pillar.get haproxy:proxy:listen:k8s_secure:binds:port)
+    export kubernetes_admin_user=$(${PYTHONPATH}/tcp_tests/utils/get_param.py -C "${KUBE_TARGET}" pillar.get kubernetes:master:admin:username)
+    export kubernetes_admin_password=$(${PYTHONPATH}/tcp_tests/utils/get_param.py -C "${KUBE_TARGET}" pillar.get kubernetes:master:admin:password)
+fi
+
+echo "export kube_host='$kube_host'  # Kubernetes API host"
+echo "export kube_apiserver_port='${kube_apiserver_port}'  # Kubernetes API port"
+echo "export kubernetes_admin_user='${kubernetes_admin_user}'  # Kubernetes admin user"
+echo "export kubernetes_admin_password='${kubernetes_admin_password}'  # Kubernetes admin password"
diff --git a/tcp_tests/utils/env_salt b/tcp_tests/utils/env_salt
new file mode 100755
index 0000000..12c4575
--- /dev/null
+++ b/tcp_tests/utils/env_salt
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# Source file to set access credentials to salt-api for using with libpepper
+# Requires:
+#  - ENV_NAME
+# Example usage:
+# $> . ./tcp_tests/utils/env_salt
+# $> pepper -C 'I@linux:system' test.ping
+
+CURRENT_DIR=$(dirname $(readlink -f "${BASH_SOURCE[0]}"))
+export PYTHONPATH=${CURRENT_DIR}/../..
+
+export SALT_MASTER_IP=${SALT_MASTER_IP:-$(for node in $(dos.py slave-ip-list --address-pool-name admin-pool01 ${ENV_NAME}); do echo $node|grep cfg01|cut -d',' -f2; done)}
+
+if [ -z "$SALT_MASTER_IP" ]; then
+    echo "SALT_MASTER_IP not found in the environment '${ENV_NAME}'"
+    unset SALT_MASTER_IP
+    unset SALTAPI_URL
+    unset SALTAPI_USER
+    unset SALTAPI_PASS
+    unset SALTAPI_EAUTH
+else
+    # For pepper client
+    export SALTAPI_URL=http://${SALT_MASTER_IP}:6969/
+    export SALTAPI_USER='salt'
+    export SALTAPI_PASS='hovno12345!'
+    export SALTAPI_EAUTH='pam'
+fi
+
+echo "export SALT_MASTER_IP='${SALT_MASTER_IP}'"
+echo "export SALTAPI_URL='${SALTAPI_URL}'"
+echo "export SALTAPI_USER='${SALTAPI_USER}'"
+echo "export SALTAPI_PASS='${SALTAPI_PASS}'"
+echo "export SALTAPI_EAUTH='${SALTAPI_EAUTH}'"
diff --git a/tcp_tests/utils/get_param.py b/tcp_tests/utils/get_param.py
new file mode 100755
index 0000000..6179e70
--- /dev/null
+++ b/tcp_tests/utils/get_param.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+
+"""
+A wrapper to ``pepper``, a CLI interface to a remote salt-api instance.
+
+Return a single parameter from the salt model for specified
+target and pillar.
+
+Fails if the result contains more than one parameter.
+
+Use the pepper CLI parameters to set salt-api access parameters
+or set the environment variables:
+
+  export SALTAPI_URL=http://${SALT_MASTER_IP}:6969/;
+  export SALTAPI_USER='salt';
+  export SALTAPI_PASS='pass';
+  export SALTAPI_EAUTH='pam';
+"""
+from __future__ import print_function
+
+import sys
+import json
+
+from pepper import cli
+
+
+runner = cli.PepperCli()
+runner.parser.description = __doc__
+
+
+if len(sys.argv) <= 1:
+    sys.argv.append('--help')
+
+results = []
+for res in runner.run():
+    results.append(res)
+
+if not results:
+    print("Empty response", file=sys.stderr)
+    sys.exit(1)
+
+if len(results) > 1:
+    print("Too many results", file=sys.stderr)
+    sys.exit(1)
+
+if results[0][0] != 0:
+    print("Error code returned", file=sys.stderr)
+    sys.exit(results[0][0])
+
+data = json.loads(results[0][1])
+nodes = data['return'][0].keys()
+
+if not nodes:
+    print("Wrong target: no minions selected", file=sys.stderr)
+    sys.exit(1)
+
+if len(nodes) > 1:
+    print("Wrong target: too many minions selected: {0}"
+          .format(nodes), file=sys.stderr)
+    sys.exit(1)
+
+print(data['return'][0][nodes[0]])
diff --git a/tcp_tests/utils/run_jenkins_job.py b/tcp_tests/utils/run_jenkins_job.py
new file mode 100755
index 0000000..00ebec6
--- /dev/null
+++ b/tcp_tests/utils/run_jenkins_job.py
@@ -0,0 +1,163 @@
+#!/usr/bin/env python
+
+import argparse
+import os
+import sys
+
+import json
+
+sys.path.append(os.getcwd())
+try:
+    from tcp_tests.managers.jenkins.client import JenkinsClient
+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)
+
+
+EXIT_CODES = {
+  "SUCCESS": 0,
+  # 1 - python runtime execution error
+  # 2 - job unknown status
+  "FAILURE": 3,
+  "UNSTABLE": 4,
+  "ABORTED": 5,
+  "DISABLED": 6
+  # 10 - invalid cli options
+}
+
+
+def load_params():
+    """
+    Parse CLI arguments and environment variables
+
+    Returns: ArgumentParser instance
+    """
+    env_host = os.environ.get('JENKINS_URL', None)
+    env_username = os.environ.get('JENKINS_USER', None)
+    env_password = os.environ.get('JENKINS_PASS', None)
+    env_start_timeout = os.environ.get('JENKINS_START_TIMEOUT', 1800)
+    env_build_timeout = os.environ.get('JENKINS_BUILD_TIMEOUT', 3600 * 4)
+
+    parser = argparse.ArgumentParser(description=(
+        'Host, username and password may be specified either by the command '
+        'line arguments or using environment variables: JENKINS_URL, '
+        'JENKINS_USER, JENKINS_PASS, JENKINS_START_TIMEOUT, '
+        'JENKINS_BUILD_TIMEOUT. \nCommand line arguments have the highest '
+        'priority, after that the environment variables are used as defaults.'
+    ))
+    parser.add_argument('--host',
+                        metavar='JENKINS_URL',
+                        help='Jenkins Host',
+                        default=env_host)
+    parser.add_argument('--username',
+                        metavar='JENKINS_USER',
+                        help='Jenkins Username', default=env_username)
+    parser.add_argument('--password',
+                        metavar='JENKINS_PASS',
+                        help='Jenkins Password or API token',
+                        default=env_password)
+    parser.add_argument('--start-timeout',
+                        metavar='JENKINS_START_TIMEOUT',
+                        help='Timeout waiting until build is started',
+                        default=env_start_timeout,
+                        type=int)
+    parser.add_argument('--build-timeout',
+                        metavar='JENKINS_BUILD_TIMEOUT',
+                        help='Timeout waiting until build is finished',
+                        default=env_build_timeout,
+                        type=int)
+    parser.add_argument('--job-name',
+                        help='Jenkins job name to run',
+                        default=None)
+    parser.add_argument('--job-parameters',
+                        metavar='json-dict',
+                        help=('Job parameters to use instead of default '
+                              'values, as a json string, for example: '
+                              '--job-parameters=\'{"SALT_MASTER_URL": '
+                              '"http://localhost:6969"}\''),
+                        default={}, type=json.loads)
+    parser.add_argument('--job-output-prefix',
+                        help=('Jenkins job output prefix for each line in the '
+                              'output, if --verbose is enabled. Useful for the'
+                              ' pipelines that use multiple different runs of '
+                              'jobs. The string is a template for python '
+                              'format() function where the following arguments'
+                              ' are allowed: job_name, build_number. '
+                              'Example: --job-output-prefix=\"[ {job_name} '
+                              '#{build_number}, core ]\"'),
+                        default='',
+                        type=str)
+    parser.add_argument('--verbose',
+                        action='store_const',
+                        const=True,
+                        help='Show build console output',
+                        default=False)
+    return parser
+
+
+def print_build_header(build, job_params, opts):
+    print('\n#############################################################')
+    print('##### Building job [{0}] #{1} (timeout={2}) with the following '
+          'parameters:'.format(build[0], build[1], opts.build_timeout))
+    print('##### ' + '\n##### '.join(
+        [str(key) + ": " + str(val) for key, val in job_params.iteritems()]
+    ))
+    print('#############################################################')
+
+
+def print_build_footer(build, result, url):
+    print('\n\n#############################################################')
+    print('##### Completed job [{0}] #{1} at {2}: {3}'
+          .format(build[0], build[1], url, result))
+    print('#############################################################\n')
+
+
+def run_job(opts):
+
+    jenkins = JenkinsClient(
+        host=opts.host,
+        username=opts.username,
+        password=opts.password)
+
+    job_params = jenkins.make_defults_params(opts.job_name)
+    job_params.update(opts.job_parameters)
+
+    build = jenkins.run_build(opts.job_name,
+                              job_params,
+                              verbose=opts.verbose,
+                              timeout=opts.start_timeout)
+    if opts.verbose:
+        print_build_header(build, job_params, opts)
+
+    jenkins.wait_end_of_build(
+        name=build[0],
+        build_id=build[1],
+        timeout=opts.build_timeout,
+        interval=1,
+        verbose=opts.verbose,
+        job_output_prefix=opts.job_output_prefix)
+    result = jenkins.build_info(name=build[0],
+                                build_id=build[1])['result']
+    if opts.verbose:
+        print_build_footer(build, result, opts.host)
+
+    return EXIT_CODES.get(result, 2)
+
+
+def main(args=None):
+    parser = load_params()
+    opts = parser.parse_args()
+
+    if opts.host is None or opts.job_name is None:
+        print("JENKINS_URL and a job name are required!")
+        parser.print_help()
+        return 10
+    else:
+        exit_code = run_job(opts)
+        return exit_code
+
+
+if __name__ == "__main__":
+    sys.exit(main())
diff --git a/tcp_tests/utils/run_template_commands.py b/tcp_tests/utils/run_template_commands.py
new file mode 100755
index 0000000..5d2c178
--- /dev/null
+++ b/tcp_tests/utils/run_template_commands.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+
+import argparse
+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 execute_commands
+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 load_params():
+    """
+    Parse CLI arguments and environment variables
+
+    Returns: ArgumentParser instance
+    """
+    parser = argparse.ArgumentParser(description=(
+        'Run commands from yaml templates'
+    ))
+    parser.add_argument('path_to_template',
+                        help='Path to YAML template')
+    parser.add_argument('--template-steps-label',
+                        help=('Text that will be shown as steps label'),
+                        default='',
+                        type=str)
+
+    return parser
+
+
+def main():
+    """Create fuel-devops environment from template"""
+    parser = load_params()
+    opts = parser.parse_args()
+
+    if opts.path_to_template is None:
+        parser.print_help()
+        return 10
+
+    path = os.path.abspath(opts.path_to_template)
+    label = opts.template_steps_label
+    if not label:
+        label = os.path.basename(path).split('.')[0]
+
+    config = config_fixtures.config()
+    underlay = underlay_ssh_manager.UnderlaySSHManager(config)
+
+    commands = underlay.read_template(path)
+
+    commander = execute_commands.ExecuteCommandsMixin(config, underlay)
+    commander.execute_commands(commands, label=label)
+
+
+if __name__ == '__main__':
+    sys.exit(main())
