oasis_roles.hostname
This Role Has Been Deprecated: Please use the version in the oasis_roles.system Ansible Collection
Hostname
Sets the hostname to a specified value, and optionally injects that value and other aliases into the /etc/hosts file
Requirements
Ansible 2.4 or higher
Red Hat Enterprise Linux 7 or equivalent
Valid Red Hat Subscriptions
Role Variables
Currently the following variables are supported:
General
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.
Dependencies
None
Example Playbook
- hosts: hostname-servers
roles:
- role: oasis-roles.hostname
hostname: dev.example.com
hostname_aliases:
- dev
License
GPLv3
Author Information
Greg Hellings greg.hellings@gmail.com
Install
ansible-galaxy install oasis_roles.hostnameLicense
gpl-3.0
Downloads
2.5k
Owner
