Well it works
This commit is contained in:
3
ansible/hosts.j2
Normal file
3
ansible/hosts.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
{% for host in hostvars %}
|
||||
{{ hostvars[host]['ansible_facts']['enp5s0']['ipv4']['address'] }} {{ host }}
|
||||
{% endfor %}
|
||||
8
ansible/playbook.yml
Normal file
8
ansible/playbook.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: Replace /etc/hosts
|
||||
template:
|
||||
src: hosts.j2
|
||||
dest: /etc/hosts
|
||||
|
||||
Reference in New Issue
Block a user