Skip to content
Snippets Groups Projects

update the process for generating the /etc/hosts file to make it more robust

Merged Chris Hines requested to merge update_makehosts into master
+ 6
4
Compare changes
  • Side-by-side
  • Inline
@@ -25,10 +25,12 @@ for group in d['groups'].keys():
for h in hosts.keys():
if d['hostvars'].has_key(h):
string="%s"%(d['hostvars'][h]['ansible_eth0']['ipv4']['address'])
for name in hosts[h]:
string=string+" %s"%(name)
print string
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