--- - name: motd_deb | Install the packages that manage the dynamic motd file ansible.builtin.apt: pkg: "{{ deb_motd_packages }}" state: present update_cache: true cache_valid_time: 3600 tags: - motd - name: motd_deb | Install our motd template file ansible.builtin.template: src: motd.j2 dest: /etc/static-motd owner: root group: root mode: "0644" tags: - motd - name: motd_deb | Install the dynamic merge script of the motd file ansible.builtin.template: src: update_motd.j2 dest: /etc/update-motd.d/05-motd-message owner: root group: root mode: "0755" tags: - motd - name: motd_deb | Initialise the motd prompt ansible.builtin.shell: run-parts --lsbsysinit /etc/update-motd.d > /run/motd.dynamic && touch /etc/.custom_motd args: creates: /etc/.custom_motd failed_when: false tags: - motd