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

Merge pull request #128 from l1ll1/master

fix up dodgy script for calculating etc/hosts
parents 18e41765 f3ca6842
No related branches found
No related tags found
No related merge requests found
...@@ -16,10 +16,11 @@ hosts={} ...@@ -16,10 +16,11 @@ hosts={}
for group in d['groups'].keys(): for group in d['groups'].keys():
i=0 i=0
for h in d['groups'][group]: for h in d['groups'][group]:
name = d['hostsvars'][h]['ansible_hostname']
if not domain: if not domain:
hosts[h] = [h] hosts[h] = [name]
else: else:
hosts[h] = ['%s.%s %s'%(h,domain,h)] hosts[h] = ['%s.%s %s'%(name,domain,name)]
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