13 lines
382 B
YAML
13 lines
382 B
YAML
|
- name: Set the hostname in /etc/hostname
|
||
|
hostname:
|
||
|
name: "{{ inventory_hostname_short }}"
|
||
|
use: debian
|
||
|
- name: Configure hostname in hosts
|
||
|
blockinfile:
|
||
|
path: /etc/hosts
|
||
|
marker_begin: '--- BEGIN VN ---'
|
||
|
marker_end: '--- END VN ---'
|
||
|
marker: "# {mark}"
|
||
|
block: |
|
||
|
{{ ansible_default_ipv4.address }} {{ ansible_host }} {{ inventory_hostname_short }}
|