Updates the hostname (permanently) on a node.
Ansible version 2.9 or higher (for proper hostname
module functionality).
Available variables are listed below, along with their default values (see
defaults/main.yml
for more info):
dubzland_hostname_fqdn: "{{ inventory_hostname }}"
Full hostname + domain (FQDN).
dubzland_hostname_ip: ""
IP address to associate with this host in /etc/hosts
(leave blank to avoid
writing to the hosts file.
None.
- hosts: all
roles:
- role: dubzland-hostname
vars:
dubzland_hostname_fqdn: "host1.example.com"
MIT