# -*-coding:utf-8 -*-
from ansible_api import exec_ansible
import json,requests


def get_info():
	info = exec_ansible(module='setup',args='',host='172.17.0.3')
	print type(info)
	data = json.dumps(info)
	url = "http://192.168.2.120/api_host_info"
	r = requests.post(url, data=data)
	print r.status_code
	# req = urllib2.Requestreq = urllib2.Request(url, data=info)
	# print req
	# res_data = urllib2.urlopen(req)
	# res = res_data.read()
	# print res
	
get_info()