Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # {{ansible_managed}}
- 127.0.0.1 localhost.localdomain localhost
- {% for item in groups['all'] %}
- {{ hostvars[item]['ansible_default_ipv4']['address'] }} {{ item }} {{ item }}.site.com
- {% endfor %}
- ----------- cut --------------------------------
- this is a hosts.j2 tempalte file that goes under tempalte folder.
- i call the role like this
- ---
- - name: Cleanup VM
- hosts: cleanup
- remote_user: root
- roles:
- - cleanup
- - name: Install Common
- hosts: all
- remote_user: root
- roles:
- - common
- - name: Install hosts configuration
- hosts: all
- remote_user: root
- roles:
- - hosts
- (...)
- i have other stuff there but it breaks on the hosts role.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement