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-04 11:15:55 +00:00
|
|
|
- name: Populating hosts file with hostname
|
|
|
|
lineinfile:
|
2024-10-01 12:14:51 +00:00
|
|
|
path: /etc/hosts
|
2024-10-04 11:15:55 +00:00
|
|
|
regexp: '^127.0.1.1'
|
|
|
|
line: '127.0.1.1 {{ ansible_host }} {{ inventory_hostname_short }}'
|