Commit 9b3ead76 authored by Chris Hines's avatar Chris Hines
Browse files

calculating of etc/hosts file was broken in ansible2 due to changes in the way hostvars work. Fixed

parent 6ce2212f
---
- name: get_groups_json
template: dest=/tmp/groups src=groups.j2
......@@ -11,6 +12,5 @@
- name: write hosts file
template: dest=/tmp/etcHosts src=etcHosts.j2
- name: fetch hosts file
fetch: src=/tmp/etcHosts dest=files/etcHosts flat=yes
{
"groups": {{ groups | to_nice_json }},
"hostvars": {{ hostvars | to_nice_json }}
"hostvars": {
{% for host in groups['all'] %}
"{{ host }}" : {{ hostvars[host]|to_nice_json }}
{% if not loop.last %}
,
{% endif %}
{% endfor %}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment