2024-10-01 14:01:16 +00:00
|
|
|
- name: Set the hostname
|
2024-10-01 12:14:51 +00:00
|
|
|
hostname:
|
|
|
|
name: "{{ inventory_hostname_short }}"
|
|
|
|
use: debian
|
2024-10-01 14:01:16 +00:00
|
|
|
- name: Configure hosts file
|
2024-10-01 12:14:51 +00:00
|
|
|
blockinfile:
|
|
|
|
path: /etc/hosts
|
|
|
|
marker_begin: '--- BEGIN VN ---'
|
|
|
|
marker_end: '--- END VN ---'
|
|
|
|
marker: "# {mark}"
|
|
|
|
block: |
|
|
|
|
{{ ansible_default_ipv4.address }} {{ ansible_host }} {{ inventory_hostname_short }}
|