-change hosts file - will maintain hosts file on multipe machines.

for the scope of this type of demo network, this is much simpler
than installing and managing dns.
This commit is contained in:
Pi
2019-03-14 12:55:33 -04:00
parent 0e8a36b1a4
commit 23915d0549
13 changed files with 89 additions and 30 deletions

View File

@@ -16,3 +16,10 @@
- /home/pi/Documents/smb
- /home/pi/scripts
tags: create_dirs
- name: update hosts file
become: true
blockinfile:
dest: /etc/hosts
content: "{{ lookup('template', '{{ role_path }}/templates/hosts.j2') }}"
state: present
tags: update_hosts

View File

@@ -0,0 +1,7 @@
{% for item in ansible_play_batch %}
{{ hostvars[item].ansible_host }} {{ item }}.demo.dsfinancial.com
{% endfor %}
{% for item in ansible_play_batch %}
{{ hostvars[item].ansible_host }} {{ item }}
{% endfor %}