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.
This commit is contained in:
5
hostname.yml
Normal file
5
hostname.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
- hosts: all
|
||||
tasks:
|
||||
- name: ensure hostname is set
|
||||
hostname:
|
||||
name={{ preferred_hostname|d(inventory_hostname) }}
|
||||
Reference in New Issue
Block a user