Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chris Hines
ansible_cluster_in_a_box
Commits
9b3ead76
Commit
9b3ead76
authored
Feb 10, 2016
by
Chris Hines
Browse files
calculating of etc/hosts file was broken in ansible2 due to changes in the way hostvars work. Fixed
parent
6ce2212f
Changes
2
Hide whitespace changes
Inline
Side-by-side
roles/calculateEtcHosts/tasks/main.yml
View file @
9b3ead76
---
-
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
roles/calculateEtcHosts/templates/groups.j2
View file @
9b3ead76
{
"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 %}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment