vn-ansible/roles/debian-host/tasks/hostname.yml

10 lines
282 B
YAML
Raw Normal View History

2024-10-16 15:53:15 +00:00
- name: Set the hostname
hostname:
name: "{{ inventory_hostname_short }}"
use: debian
- name: Populating hosts file with hostname
lineinfile:
path: /etc/hosts
regexp: '^127\.0\.1\.1'
line: '127.0.1.1 {{ hostname_fqdn }} {{ inventory_hostname_short }}'