Commit 6f3c4241 authored by Ioannis Tsafaras's avatar Ioannis Tsafaras

Minor path fix, reformat code

parent 0a716605
import inspect
import os import os
import tempfile import tempfile
import ansible import ansible
...@@ -73,7 +74,6 @@ class Manager: ...@@ -73,7 +74,6 @@ class Manager:
all_group.add_child_group(slaves_group) all_group.add_child_group(slaves_group)
# print self.ansible_inventory.groups_list() # print self.ansible_inventory.groups_list()
return self.ansible_inventory return self.ansible_inventory
def run_playbook(self, playbook_file, tags=None): def run_playbook(self, playbook_file, tags=None):
...@@ -103,6 +103,7 @@ if __name__ == "__main__": ...@@ -103,6 +103,7 @@ if __name__ == "__main__":
'pk': 'Dummy pk', 'pk': 'Dummy pk',
u'subnet': {u'cidr': u'192.168.0.0/24', u'gateway_ip': u'192.168.0.1', u'id': u'142761'}} u'subnet': {u'cidr': u'192.168.0.0/24', u'gateway_ip': u'192.168.0.1', u'id': u'142761'}}
script_path = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
manager = Manager(response) manager = Manager(response)
manager.create_inventory() manager.create_inventory()
# manager.run_playbook(playbook_file=script_path + "/../../ansible/playbooks/testinventory.yml", tags=['hosts']) # manager.run_playbook(playbook_file=script_path + "/../../ansible/playbooks/testinventory.yml", tags=['hosts'])
......
...@@ -15,7 +15,6 @@ if __name__ == "__main__": ...@@ -15,7 +15,6 @@ if __name__ == "__main__":
default="lambda.grnet.gr") default="lambda.grnet.gr")
parser.add_argument('--name', type=str, dest='name', default="to mikro debian sto livadi") parser.add_argument('--name', type=str, dest='name', default="to mikro debian sto livadi")
parser.add_argument('--slaves', type=int, dest='slaves', default=2) parser.add_argument('--slaves', type=int, dest='slaves', default=2)
parser.add_argument('--vcpus_master', type=int, dest='vcpus_master', default=4) parser.add_argument('--vcpus_master', type=int, dest='vcpus_master', default=4)
parser.add_argument('--vcpus_slave', type=int, dest='vcpus_slave', default=4) parser.add_argument('--vcpus_slave', type=int, dest='vcpus_slave', default=4)
...@@ -31,16 +30,16 @@ if __name__ == "__main__": ...@@ -31,16 +30,16 @@ if __name__ == "__main__":
args = parser.parse_args() args = parser.parse_args()
provisioner = Provisioner(cloud_name=args.cloud) provisioner = Provisioner(cloud_name=args.cloud)
provisioner.create_lambda_cluster('test_vm', slaves=args.slaves, provisioner.create_lambda_cluster('test_vm', slaves=args.slaves,
cluster_size=args.cluster_size, cluster_size=args.cluster_size,
vcpus_master=args.vcpus_master, vcpus_master=args.vcpus_master,
vcpus_slave=args.vcpus_slave, vcpus_slave=args.vcpus_slave,
ram_master=args.ram_master, ram_master=args.ram_master,
ram_slave=args.ram_slave, ram_slave=args.ram_slave,
disk_master=args.disk_master, disk_master=args.disk_master,
disk_slave=args.disk_slave, disk_slave=args.disk_slave,
ip_request=args.ip_request, ip_request=args.ip_request,
network_request=args.network_request, network_request=args.network_request,
project_name=args.project_name) project_name=args.project_name)
provisioner_response = provisioner.get_cluster_details() provisioner_response = provisioner.get_cluster_details()
master_id = provisioner_response['nodes']['master']['id'] master_id = provisioner_response['nodes']['master']['id']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment