Well it works

This commit is contained in:
2024-01-27 23:26:11 +03:00
commit f8e6ed30d3
11 changed files with 223 additions and 0 deletions

3
ansible/hosts.j2 Normal file
View File

@@ -0,0 +1,3 @@
{% for host in hostvars %}
{{ hostvars[host]['ansible_facts']['enp5s0']['ipv4']['address'] }} {{ host }}
{% endfor %}

8
ansible/playbook.yml Normal file
View File

@@ -0,0 +1,8 @@
---
- hosts: all
tasks:
- name: Replace /etc/hosts
template:
src: hosts.j2
dest: /etc/hosts