diff --git a/deploy-tws-motd b/deploy-tws-motd index 1b7a906..6747c70 100644 --- a/deploy-tws-motd +++ b/deploy-tws-motd @@ -8,14 +8,20 @@ tws_short: "TWS" tasks: - - name: Disable default Ubuntu MOTD noise - file: + - name: Check for default Ubuntu MOTD scripts + stat: path: "/etc/update-motd.d/{{ item }}" - mode: "0644" loop: - 10-help-text - 50-motd-news - ignore_errors: true + register: motd_scripts + + - name: Disable default Ubuntu MOTD noise + file: + path: "{{ item.stat.path }}" + mode: "0644" + loop: "{{ motd_scripts.results }}" + when: item.stat.exists - name: Deploy TWS MOTD script copy: