From b0cf0a1429df67344f02be6a9b5128ce9d315533 Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Wed, 28 Oct 2020 17:12:14 +0100 Subject: [PATCH] lib/hardware: introduce ANSIBLE_PLAYBOOK_EXTRA_ARGS This change makes it possible to add extra variables for ansible-playbook calls, this is usefull when one want to pass multiple --extra-vars arguments in the native format giving user a choice to use json, name=value pairs or path to yaml/json files. Signed-off-by: Kyr Shatskyy --- tests/lib/hardware/hardware_base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/lib/hardware/hardware_base.py b/tests/lib/hardware/hardware_base.py index 5532b9ad..88e52705 100644 --- a/tests/lib/hardware/hardware_base.py +++ b/tests/lib/hardware/hardware_base.py @@ -159,10 +159,12 @@ def ansible_run_playbook(self, playbook: str, else: extra_vars_param = "" + extra_args = settings.get('ANSIBLE_PLAYBOOK_EXTRA_ARGS', '') + logger.info(f'Running playbook {path} ({limit})') self.workspace.execute( f"ansible-playbook -i {self._ansible_inventory_dir} " - f"{limit} {extra_vars_param} {path}", + f"{limit} {extra_vars_param} {extra_args} {path}", logger_name=f"ansible {playbook}") def _ansible_create_inventory(self):