Skip to content
Snippets Groups Projects
Commit 5459641a authored by Chris Hines's avatar Chris Hines
Browse files

Merge branch 'update_makehosts' into 'master'

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

See merge request !53
parents 3c2d0c72 79dec8da
No related branches found
No related tags found
No related merge requests found
...@@ -25,10 +25,12 @@ for group in d['groups'].keys(): ...@@ -25,10 +25,12 @@ for group in d['groups'].keys():
for h in hosts.keys(): for h in hosts.keys():
if d['hostvars'].has_key(h): if d['hostvars'].has_key(h):
string="%s"%(d['hostvars'][h]['ansible_eth0']['ipv4']['address']) for addr in d['hostvars'][h]['ansible_all_ipv4_addresses']:
for name in hosts[h]: if "172.16.200" in addr:
string=string+" %s"%(name) string="%s"%addr
print string for name in hosts[h]:
string=string+" %s"%(name)
print string
for h in hosts.keys(): for h in hosts.keys():
if d['hostvars'].has_key(h): if d['hostvars'].has_key(h):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment