Skip to content

Commit

Permalink
lib/hardware: introduce ANSIBLE_PLAYBOOK_EXTRA_ARGS
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Kyr Shatskyy committed Oct 29, 2020
1 parent 4dc5510 commit b0cf0a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/lib/hardware/hardware_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit b0cf0a1

Please sign in to comment.