hostname: Also write /etc/hosts
This commit introduces a new role, *hostname*, that is used by the `hostname.yml` playbook to set the hostname. It also writes `/etc/hosts` using a template.
This commit is contained in:
2
roles/hostname/templates/hosts.j2
Normal file
2
roles/hostname/templates/hosts.j2
Normal file
@@ -0,0 +1,2 @@
|
||||
127.0.0.1 {{ preferred_hostname }} {{ preferred_hostname.split('.')[0] }} localhost localhost.localdomain localhost4 localhost4.localdomain4
|
||||
::1 {{ preferred_hostname }} {{ preferred_hostname.split('.')[0] }} localhost localhost.localdomain localhost6 localhost6.localdomain6
|
||||
Reference in New Issue
Block a user