Last active
March 21, 2016 19:38
-
-
Save CaptTofu/2093f8cac2228a81a0a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Create a docker.yml file | |
hosts: "{{ hosts }}" | |
gather_facts: yes | |
tasks: | |
- name: inventory template | |
local_action: template src=docker.inv.j2 dest=./docker.inv | |
and the template: | |
[containers] | |
{% for key in hostvars %} | |
{{ key }} ansible_host={{ hostvars[key]['ansible_default_ipv4']['address'] }} | |
{% endfor %} | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment