From 0ab318fcd287cfca56dc220811019db7a7373a25 Mon Sep 17 00:00:00 2001 From: Matthew Fennell Date: Sun, 10 Aug 2025 21:21:58 +0100 Subject: Set hostname in playbook Some services, such as munin, read the hostname from the system, and don't allow "virtual host" configuration like prosody. For such services, we want to make sure the hostname is set correctly. --- playbook.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'playbook.yaml') diff --git a/playbook.yaml b/playbook.yaml index 06f75e0..2c8ea28 100644 --- a/playbook.yaml +++ b/playbook.yaml @@ -61,6 +61,20 @@ mode: "0644" become: true + - name: Ensure hostname is set + ansible.builtin.hostname: + name: "{{ hostname }}" + become: true + + - name: Ensure hostname is configured in /etc/hosts + ansible.builtin.template: + src: "{{ playbook_dir }}/files/hosts.j2" + dest: /etc/hosts + owner: root + group: root + mode: "0644" + become: true + - name: Retrieve DANE hash ansible.builtin.shell: cmd: > -- cgit v1.2.3