Skip to content
Snippets Groups Projects

Add karaage version, fixed calculateEtcHosts

Closed Jupiter Hu requested to merge AddKaraageCommitVersion into master
+ 9
11
Compare changes
  • Side-by-side
  • Inline
Files
@@ -17,7 +17,7 @@ for group in d['groups'].keys():
i=0
for h in d['groups'][group]:
name = d['hostvars'][h]['ansible_hostname']
name = h
# name = h
if not domain:
hosts[h] = [name]
else:
@@ -25,12 +25,13 @@ for group in d['groups'].keys():
for h in hosts.keys():
if d['hostvars'].has_key(h):
for addr in d['hostvars'][h]['ansible_all_ipv4_addresses']:
if "172.16.200" in addr:
string="%s"%addr
for name in hosts[h]:
string=string+" %s"%(name)
print string
string="%s"%(d['hostvars'][h]['ansible_eth0']['ipv4']['address'])
# for addr in d['hostvars'][h]['ansible_all_ipv4_addresses']:
# if "172.16.200" in addr:
# string="%s"%addr
for name in hosts[h]:
string=string+" %s"%(name)
print string
for h in hosts.keys():
if d['hostvars'].has_key(h):
Loading