Skip to content
Snippets Groups Projects
Commit 78ccbc59 authored by Chris Hines's avatar Chris Hines
Browse files

use the resolveHosts role to allow nodes to resolve other nodes by name....

use the resolveHosts role to allow nodes to resolve other nodes by name. conifugre the dependenices for resolveHosts to use the role etcHosts if you would like to put all hosts in /etc/hosts or create a new role for a dnsclient if you would prefer
parent 88a67db1
No related branches found
No related tags found
No related merge requests found
---
domain: testdomain.massive.org.au
- name: get_groups_json
template: dest=/tmp/groups src=groups.j2
run_once: True
delegate_to: 127.0.0.1
- name: make hosts data
command: ./scripts/makehosts.py /tmp/groups {{ domain }}
delegate_to: 127.0.0.1
run_once: True
register: hosts_data
- name: write hosts file
lineinfile:
args:
dest: /etc/hosts
line: "{{ item }}"
state: present
sudo: true
with_items: hosts_data.stdout_lines
{
"groups": {{ groups | to_nice_json }},
"hostvars": {{ hostvars | to_nice_json }}
}
---
dependencies:
- { role: commonVars }
- { role: etcHosts }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment