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.
jenkins-master
Dustin 2018-01-02 23:37:00 -06:00
parent 7f86881b7c
commit e327db1f4f
1 changed files with 5 additions and 0 deletions

5
hostname.yml Normal file
View File

@ -0,0 +1,5 @@
- hosts: all
tasks:
- name: ensure hostname is set
hostname:
name={{ preferred_hostname|d(inventory_hostname) }}