Skip to content

Latest commit

 

History

History
51 lines (35 loc) · 1.26 KB

File metadata and controls

51 lines (35 loc) · 1.26 KB

Ansible Role - havlasme.linux.hostname

Apache-2.0 license

An Ansible role to set the linux hostname on Debian and Ubuntu running systemd.

  • Install or Update the HostName Support via APT
  • Set the Linux HostName

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

# hostname package state ('present', 'latest') - 'absent' is not supported
# * 'present' ensures that the package is installed
# * 'latest' ensures that the latest version of the package is installed
linux_hostname__state: 'present'

# linux hostname
#linux_hostname: 'hostname'

Example Playbook

- hosts: 'all'

  tasks:
  - ansible.builtin.include_role:
      name: 'havlasme.linux.hostname'
    vars:
      linux_hostname: 'my-awesome-host'

License

Apache-2.0

Author Information

Created in 2024 by Tomáš Havlas.