Files
configpolicy/hostname.yml
Dustin C. Hatch e327db1f4f hostname: Playbook to set system hostname
The `hostname.yml` playbook does what it says on the tin: it sets the
hostname of the managed node. The `preferred_hostname` variable can be
used to specify the value to use for the hostname. If it is not set, the
name specified in the inventory is used.
2018-01-02 23:37:00 -06:00

6 lines
127 B
YAML

- hosts: all
tasks:
- name: ensure hostname is set
hostname:
name={{ preferred_hostname|d(inventory_hostname) }}