1
0
forked from finallycoffee/base

feat(hostname): add playbook for hostname management

This commit is contained in:
2025-04-26 19:17:19 +02:00
parent e27eb145f1
commit 038ad4b07e

10
playbooks/hostname.yml Normal file
View File

@ -0,0 +1,10 @@
---
- name: Ensure hostname is managed
hosts: "{{ hostname_targets | default('hostname_managed') }}"
become: "{{ hostname_target_become | default(true) }}"
gather_facts: false
tasks:
- name: Ensure hostname is up to date
ansible.builtin.hostname:
name: "{{ hostname | default(inventory_hostname, true) }}"
use: "{{ hostname_strategy | default(omit, true) }}"