From a90871a32f781eafce5be968d279b1f4105f5572 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 19 Feb 2019 12:18:56 +0100 Subject: [PATCH] motd: Make the motd update task resilient to playbook failures. --- motd/tasks/deb_motd.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/motd/tasks/deb_motd.yml b/motd/tasks/deb_motd.yml index 72367a3..bb82a9a 100644 --- a/motd/tasks/deb_motd.yml +++ b/motd/tasks/deb_motd.yml @@ -2,7 +2,6 @@ - block: - name: Install the packages that manage the dynamic motd file on debian based distributions apt: pkg={{ deb_motd_packages }} state=present update_cache=yes cache_valid_time=3600 - register: motd_pkgs - name: Install our motd template file on debian based distributions template: src=motd.j2 dest=/etc/static-motd owner=root group=root mode=0644 @@ -11,7 +10,8 @@ template: src=update_motd.j2 dest=/etc/update-motd.d/05-motd-message owner=root group=root mode=0755 - name: Initialise the motd prompt on debian based distributions - command: run-parts --lsbsysinit /etc/update-motd.d > /run/motd.dynamic - when: motd_pkgs is changed + shell: run-parts --lsbsysinit /etc/update-motd.d > /run/motd.dynamic && touch /etc/.custom_motd + args: + creates: /etc/.custom_motd tags: motd