---
- name: Create a tar.gz archive of a single file.
  archive:
    path: /etc/update-motd.d/*
    dest: /etc/update-motd.d/motd.tar.gz
    format: gz
    force_archive: true

- name: remove a motd.d files
  file:
    path: /etc/update-motd.d/{{ item }}
    state: absent
  with_items:
    - 10-help-text
    - 85-fwupd
    - 90-updates-available
    - 91-release-upgrade
    - 95-hwe-eol
    - 98-fsck-at-reboot
    - 50-motd-news
    - 88-esm-announce

- name: Create login banner
  copy:
    src: login_banner
    dest: /etc/update-motd.d/00-header
    owner: root
    group: root
    mode: 0755
