Skip to content

Commit

Permalink
ansible hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
darknight-007 committed Oct 12, 2017
1 parent 2a706fb commit 7fee00c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions webclient/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
import json
import os.path
from random import randint
import subprocess
import os
import ansible.runner


import re
import sys
Expand Down Expand Up @@ -393,6 +397,14 @@ def cleanUpAndFixImages(request):
helper_ops.updateAllImageSizes(request.scheme, request.get_host())
return HttpResponse("All images rows cleaned up and fixed.")

@csrf_exempt
def simulate(request):
num_uavs = request.GET['num_uavs']
port_prefix=request.GET['port_prefix']
results = ansible.runner.Runner(pattern='172.19.0.1',module_name='command', module_args='sh /home/jdas/open-uav/Firmware/testScripts/ansible-openuav-launch.sh ' + num_uavs + ' ' + port_prefix,).run()
return JsonResponse(results)



'''
Request: POST
Expand Down

0 comments on commit 7fee00c

Please sign in to comment.