Sys-hostname Role¶
Description: No description available
Variables¶
author: Kevin Veen-Birkenbach
description: Set the system hostname based on the inventory_hostname
license: Infinito.Nexus NonCommercial License
license_url: https://s.infinito.nexus/license
company: Kevin Veen-Birkenbach
Consulting & Coaching Solutions https://www.veen.world
galaxy_tags: [‘system’, ‘hostname’]
repository: https://s.infinito.nexus/code
issue_tracker_url: https://s.infinito.nexus/issues
documentation: https://s.infinito.nexus/code/roles/sys-hostname
run_after: []
README¶
Hostname¶
This Ansible role ensures that the target host’s system hostname is set to the inventory hostname.
Description¶
Uses the built-in
hostnamemodule to apply theinventory_hostnamevalueIdempotent: only changes the system name if it differs
No external dependencies
Overview¶
Task
set hostname to {{ inventory_hostname }}Applies the desired hostname.
Module
Leverages Ansible’s
`hostname<https://docs.ansible.com/ansible/latest/collections/ansible/builtin/hostname_module.html>`__ module.
Features¶
Simple and lightweight
Automatically adapts to your inventory names
Safe to run repeatedly