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

13 lines
358 B
YAML

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