Set the hostname when localhost is found

This commit is contained in:
2022-06-05 21:06:29 -05:00
parent 5a216542f0
commit 7e5a008161
+6
View File
@@ -1,2 +1,8 @@
---
# tasks file for ensure_hostname
- name: 'Set hostname if localhost'
when:
- ansible_system == 'Linux'
- ansible_fqdn == 'localhost.localdomain'
ansible.builtin.hostname:
name: '{{ inventory_hostname }}'