Authored by chunhua.zhang

添加了uic的 inventory 文件

... ... @@ -63,6 +63,11 @@
10.66.70.96
[java-uic]
10.66.70.223
10.66.70.42
[java-union]
10.66.70.21
10.66.70.49
... ...
# inventory file for az1
[nameservers]
10.66.4.18
10.66.4.17
[java-nginx]
10.66.0.2
10.66.0.3
... ... @@ -57,6 +63,11 @@
10.66.70.96
[java-uic]
10.66.70.223
10.66.70.42
[java-union]
10.66.70.21
10.66.70.49
... ...
... ... @@ -62,6 +62,11 @@
10.66.104.48
[java-uic]
10.66.104.7
10.66.104.39
[java-union]
10.66.70.21
10.66.70.49
... ...
# inventory file for az2
[nameservers]
10.66.105.5
10.66.105.9
[java-nginx]
10.66.104.15
10.66.104.13
... ... @@ -56,6 +62,11 @@
10.66.104.48
[java-uic]
10.66.104.7
10.66.104.39
[java-union]
10.66.70.21
10.66.70.49
... ...
... ... @@ -60,6 +60,11 @@
10.66.202.39
[java-uic]
10.66.202.7
10.66.202.32
[java-union]
10.66.70.21
10.66.70.49
... ...
# inventory file for az2
[nameservers]
10.66.200.10
10.66.200.12
[java-nginx]
10.66.202.5
10.66.202.12
... ... @@ -54,6 +60,11 @@
10.66.202.39
[java-uic]
10.66.202.7
10.66.202.32
[java-union]
10.66.70.21
10.66.70.49
... ...
... ... @@ -25,7 +25,7 @@ call("git clone --recursive git@git.yoho.cn:yohoops/auto_deploy.git %s" % PATH
# get iptables info from git files.
azs_mappings = {"qcloud": "az1", "qcloudaz2": "az2", "qcloudaz3": "az3"}
host_group = { "yoho_gateway": "java-gateway",
host_group = {"yoho_gateway": "java-gateway",
"yoho_users": "java-users",
"yohobuy_resources": "java-resources",
"yohobuy_order" : "java-order",
... ... @@ -47,15 +47,16 @@ for _az in azs_mappings.keys():
all_groups[azs_mappings[_az]] = groups
file = open(os.path.join(PATH, "scripts/iptable/", _az, "app-iptable.sh"), 'r')
for line in file:
for group_name in host_group.keys():
if group_name in line:
for deploy_prj_name in host_group.keys():
if line.strip().startswith(deploy_prj_name):
g_hosts = []
groups[host_group[group_name]] = g_hosts
groups[host_group[deploy_prj_name]] = g_hosts
i_1 = line.index("(")
i_2 = line.index(")")
sub = line[i_1 + 1 : i_2]
for user_ip in sub.split(" "):
g_hosts.append(user_ip[user_ip.index("@") + 1 : ].strip())
for user_ip in sub.split("master@"):
if user_ip.strip() != '':
g_hosts.append(user_ip.strip())
file.close()
... ...