Add Ansible executor class for node context 11/33411/13
authorRoss Brattain <ross.b.brattain@intel.com>
Tue, 14 Mar 2017 05:08:06 +0000 (22:08 -0700)
committerRoss Brattain <ross.b.brattain@intel.com>
Sat, 12 Aug 2017 04:09:17 +0000 (21:09 -0700)
commitc2f99db8b4d8f021b29a4e3aae483ba715936a66
treece5cbf8443c14d1078aef5ae870235c7f706d0ad
parentae6f51c15a61e345cdc609f372ad04859d2e999d
Add Ansible executor class for node context

import the AnsibleCommon class to execute Ansible playbooks

Update node context support to use AnsibleCommon

needs unittests

We must call ansible-playbook as an executable, so we must create temp
files for inventory, and for the playbooks.

AnsibleCommon has evolved to be quite flexible, it auto-generates the
inventory from the context['nodes'] and generates groups from the node
Role.

We also support either a single playbook filename, or a list of
filenames.

If given a list we dynamically generate a playbook that includes the
other playbooks.

We support adding any number of extra_vars using a temp JSON file.

Also designed to be extended by subclassing.

Change-Id: I5bd0a2b4547feaadd70b7e2b8801f19371b99df0
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
tests/unit/benchmark/contexts/test_node.py
tests/unit/common/test_ansible_common.py [new file with mode: 0644]
yardstick/benchmark/contexts/node.py
yardstick/common/ansible_common.py [new file with mode: 0644]
yardstick/common/utils.py