...
|
...
|
@@ -10,7 +10,7 @@ import json |
|
|
import os
|
|
|
from subprocess import call
|
|
|
from jinja2 import Environment, PackageLoader
|
|
|
|
|
|
import collections
|
|
|
|
|
|
# clone deploy project to local
|
|
|
HOME = os.path.expanduser("~")
|
...
|
...
|
@@ -32,7 +32,12 @@ host_group = { "yoho_gateway": "java-gateway", |
|
|
"yohobuy_promotion": "java-promotion",
|
|
|
"yohobuy_product": "java-product",
|
|
|
"yoho_message": "java-message",
|
|
|
"yoho_sns": "java-sns"
|
|
|
"yoho_sns": "java-sns",
|
|
|
"yohobuy_brower": "java-brower",
|
|
|
"yohobuy_activity": "java-activity",
|
|
|
"yoho_erp_gateway": "java-erpgateway",
|
|
|
"yohobuy_wechat": "java-wechat",
|
|
|
"yohobuy_union": "java-union"
|
|
|
}
|
|
|
# all available zone groups
|
|
|
all_groups = {}
|
...
|
...
|
@@ -69,8 +74,9 @@ for _az in azs_mappings.keys(): |
|
|
file = open(hosts, 'w')
|
|
|
|
|
|
#write template
|
|
|
sorted_dict = collections.OrderedDict(sorted(all_groups[az].keys()))
|
|
|
template = env.get_template('inventory-%s.j2' % az)
|
|
|
file.write(template.render(groups = all_groups[az]))
|
|
|
file.write(template.render(groups = sorted_dict ))
|
|
|
file.close()
|
|
|
|
|
|
|
...
|
...
|
|