gen_inventory.py 444 Bytes
#!/usr/bin/env python
# coding=utf-8

""""
   generate ansible inventory files from auto-deploy: http://git.yoho.cn/yohoops/auto_deploy/tree/master/scripts/iptable
"""


import json

from subprocess import call

call("mkdir -p ~/.tmp")
call("rm -rf ~/.tmp/auto_deploy")
call("git clone  --recursive git@git.yoho.cn:yohoops/auto_deploy.git",  "~/.tmp/")




print("success write ansible inventory hosts files to file: [inventory_hosts]")