From 1bd02699446f7334723485fe6d891376405e33f5 Mon Sep 17 00:00:00 2001 From: staticsafe Date: Sat, 22 Aug 2020 19:00:39 -0400 Subject: [PATCH] make sure to set hostname on new nodes and turn off motd news on focal --- ubuntu/roles/common/tasks/main.yml | 4 ++++ ubuntu/roles/turn-off-motd-news/tasks/main.yml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ubuntu/roles/common/tasks/main.yml b/ubuntu/roles/common/tasks/main.yml index a043319..4063e2b 100644 --- a/ubuntu/roles/common/tasks/main.yml +++ b/ubuntu/roles/common/tasks/main.yml @@ -64,3 +64,7 @@ - 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 diff --git a/ubuntu/roles/turn-off-motd-news/tasks/main.yml b/ubuntu/roles/turn-off-motd-news/tasks/main.yml index e665f37..6aa27a2 100644 --- a/ubuntu/roles/turn-off-motd-news/tasks/main.yml +++ b/ubuntu/roles/turn-off-motd-news/tasks/main.yml @@ -2,7 +2,7 @@ # This role turns off the MOTD news in Ubuntu 18.04 - name: Copy motd-news file - when: ansible_distribution_release == 'bionic' + when: ansible_distribution_release == 'bionic' or ansible_distribution_release == 'focal' copy: src: motd-news dest: /etc/default/motd-news