Files
ansible-tasks/update-hostname.yml
2026-03-15 16:04:42 +01:00

14 lines
382 B
YAML

---
# Update all hostnames from ansible_inventory
#
# Run:
# ansible-playbook -i inventory/hosts tasks/system/network/update-hostname.yml
#
# Prepare:
# See readme.md and init your workspace
# This playbook will update the hostname of the remote hosts to match the inventory. It will also update the /etc/hosts file to reflect the new hostname.
- hosts: all
roles:
- network