add hosts file

This commit is contained in:
Gilles Mouchet 2024-05-22 17:20:04 +02:00
parent 38c1728c04
commit 32d60e44ba
2 changed files with 10 additions and 1 deletions

9
hosts.yml Normal file
View File

@ -0,0 +1,9 @@
---
- name: build hosts file
lineinfile:
dest: /etc/hosts
insertafter: EOF
line: '{{ item }}'
state: present
with_items:
- '{{ ansible_default_ipv4.address }} {{ ansible_hostname }} {{ ansible_fqdn }}'

View File

@ -4,7 +4,7 @@
tasks: tasks:
- include_tasks: assert-vars.yml - include_tasks: assert-vars.yml
# - include_tasks: disable_ipv6.yml # - include_tasks: disable_ipv6.yml
# - include_tasks: hosts.yml - include_tasks: hosts.yml
# - include_tasks: inst_packages.yml # - include_tasks: inst_packages.yml
# - include_tasks: misc.yml # - include_tasks: misc.yml