From 2d2e5a78c519f8e08409f3bc1d00c2f179b81a49 Mon Sep 17 00:00:00 2001 From: staticsafe Date: Wed, 25 Nov 2020 16:20:16 -0500 Subject: [PATCH] we should set hostname before package installation --- ubuntu/roles/common/tasks/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ubuntu/roles/common/tasks/main.yml b/ubuntu/roles/common/tasks/main.yml index 77a4c40..bc24494 100644 --- a/ubuntu/roles/common/tasks/main.yml +++ b/ubuntu/roles/common/tasks/main.yml @@ -16,6 +16,10 @@ notify: - restart rsyslog - restart cron +- name: Set hostname + hostname: + name: "{{ inventory_hostname }}" + use: systemd - name: Install required packages apt: name: "{{ packages }}" @@ -65,7 +69,3 @@ - chrony - name: Ensure that the periodic APT cron task clears out old kernels and does unattended security upgrades copy: src=10periodic dest=/etc/apt/apt.conf.d/10periodic backup=yes owner=root group=root mode=0644 -- name: Set hostname - hostname: - name: "{{ inventory_hostname }}" - use: systemd