12 lines
304 B
YAML
12 lines
304 B
YAML
- hosts: [{{host}}]
|
|
sudo: yes
|
|
tasks:
|
|
{% for val in hosts %}
|
|
- name: Create hosts entries for {{val['name']}} => {{val['ip']}}
|
|
lineinfile:
|
|
dest: /etc/hosts
|
|
regexp: '.*{{val['name']}}$'
|
|
line: '{{val['ip']}} {{val['name']}}'
|
|
state: present
|
|
{% endfor %}
|