summaryrefslogtreecommitdiffstats
path: root/apex/common/utils.py
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2018-07-16 14:14:26 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-07-16 14:14:26 +0000
commitb5e2f1f65dee0cd692fe275d6bce69a8e410cac3 (patch)
treecc212ff450702320fb1330e5c1add769fc708729 /apex/common/utils.py
parent320cbf7d8b69fefb467b85a713c791f6a29b662a (diff)
parent10c4d35315d7ffd909520a1c7bc6a3b5b9b871ab (diff)
Merge "Add support for kubernetes deployment"
Diffstat (limited to 'apex/common/utils.py')
-rw-r--r--apex/common/utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/apex/common/utils.py b/apex/common/utils.py
index 2ac900a3..013c7ac8 100644
--- a/apex/common/utils.py
+++ b/apex/common/utils.py
@@ -75,12 +75,17 @@ def run_ansible(ansible_vars, playbook, host='localhost', user='root',
Executes ansible playbook and checks for errors
:param ansible_vars: dictionary of variables to inject into ansible run
:param playbook: playbook to execute
+ :param host: inventory file or string of target hosts
+ :param user: remote user to run ansible tasks
:param tmp_dir: temp directory to store ansible command
:param dry_run: Do not actually apply changes
:return: None
"""
logging.info("Executing ansible playbook: {}".format(playbook))
- inv_host = "{},".format(host)
+ if not os.path.isfile(host):
+ inv_host = "{},".format(host)
+ else:
+ inv_host = host
if host == 'localhost':
conn_type = 'local'
else: