summaryrefslogtreecommitdiffstats
path: root/func/driver.py
blob: 45ec3fa26499a0101a656b1129e8e32ffc819105 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
##############################################################################
# Copyright (c) 2015 Dell Inc  and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################



import os


class Driver:

    def __init__(self):
        print "Class driver initialized\n"

    def drive_bench(self, benchmark, roles):
        result_dir = '$PWD/results'
        benchmark_name = benchmark + '.yaml'
        print roles
        for k, v in roles:
            print k
            run_play = 'ansible-playbook -s $PWD/benchmarks/playbooks/{0} --extra-vars "Dest_dir={1} role={2}" -vvv'.format(
                benchmark_name, result_dir, k)

            status = os.system(run_play)