ansible-collection-kit/roles/hostname
2022-03-31 19:15:09 +02:00
..
defaults Add hostname_update_etc_hosts variable 2021-09-13 23:59:43 +02:00
molecule/default Add molecule tests 2021-09-14 00:05:36 +02:00
tasks Use FQCN 2022-03-31 19:15:09 +02:00
README.md Specify that the hostname as a default 2021-09-14 00:10:28 +02:00

Hostname

Sets the hostname to a specified value and configure the 127.0.1.1 entry of /etc/hosts to the same value. Optionally it will also other aliases inside /etc/hosts.

Role Variables

  • hostname_become - Default: true. Enable/disable the Ansible become functionality.
  • hostname_become_user - Default: root. When using become functionality for privilege escalation, this is the user with desired privileges you become.
  • hostname - Default: ansible_fqdn. The hostname to set.
  • hostname_update_etc_hosts - Default: If true update 127.0.1.1 entry in /etc/hosts with hostname and aliases.
  • hostname_aliases - Default: []. Optional array of hostnames set into /etc/hosts.

Example Playbook

- hosts: my-server
  vars:
    hostname: example.org
    hostname_aliases:
      - example
  roles:
    - eriol.kit.hostname