This Role Has Been Deprecated: Please use the version in the oasis_roles.system Ansible Collection
Sets the hostname to a specified value, and optionally injects that value and other aliases into the /etc/hosts file
Ansible 2.4 or higher
Red Hat Enterprise Linux 7 or equivalent
Valid Red Hat Subscriptions
Currently the following variables are supported:
hostname
- The (probably FQDN) hostname to set for the hosthostname_aliases
- An optional array of shortened hostnames to set into the /etc/hosts file.hostname_inject_hosts_files
- Set to false if you do not wish to inject lines into the hosts files. Defaults totrue
.hostname_become
- Set to false if you do not wish to sudo/become a privileged user for the hostname injection (does not affect becoming root to set the hostname). Defaults totrue
.hostname_become_user
- Set to the value of user who should inject the lines into the hosts files. Defaults toroot
.
None
- hosts: hostname-servers
roles:
- role: oasis-roles.hostname
hostname: dev.example.com
hostname_aliases:
- dev
GPLv3
Greg Hellings greg.hellings@gmail.com