Set the hostname when localhost is found

This commit is contained in:
Jason Rothstein 2022-06-05 21:06:29 -05:00
parent 79b29a8297
commit dccb12df73

View File

@ -1,2 +1,8 @@
--- ---
# tasks file for ensure_hostname # tasks file for ensure_hostname
- name: 'Set hostname if localhost'
when:
- ansible_system == 'Linux'
- ansible_fqdn == 'localhost.localdomain'
ansible.builtin.hostname:
name: '{{ inventory_hostname }}'