gibbs.update_motd

Ansible Role: Update MOTD

Build Ansible Role License

Description

Manage dynamic MOTD (Message of the Day) scripts on Ubuntu and Debian systems.

Installation

Ansible Galaxy

To install the role from Ansible Galaxy, use:

$ ansible-galaxy install gibbs.update_motd

Example

Playbook

Here’s an example of how to use this role in your playbook:

- hosts: all
  roles:
    - gibbs.update_motd

Disable MOTD Scripts

You can disable specific MOTD scripts by providing their filenames in update_motd_disable_scripts. All other scripts in /etc/update-motd.d/ remain active.

- hosts: all
  roles:
    - gibbs.update_motd
  vars:
    update_motd_disable_scripts:
      - 88-esm-announce
      - 91-release-upgrade
      - 91-contract-ua-esm-status

Adding Custom MOTD Scripts

This role will automatically enable any scripts in /etc/update-motd.d/ that are not explicitly disabled. You can add new scripts like this:

- hosts: all
  tasks:
    - name: Copy my MOTD script
      ansible.builtin.copy:
        src: files/my-script.sh
        dest: /etc/update-motd.d/50-my-script
      notify: "Update dynamic MOTD"

Role Variables

You can override the following role variables, which are listed in defaults/main.yml:

Name Default Value Description
update_motd_remove_motd_directory false Remove /etc/motd if it exists
update_motd_package_name update-motd Name of the update-motd package (Ubuntu only)
update_motd_package_state present Desired state of the update-motd package (Ubuntu only)
update_motd_service_state start Desired state of the update-motd service (Ubuntu only)
update_motd_service_enabled true Enable the update-motd service (Ubuntu only)
update_motd_landscape_state present State of the landscape-common package (Ubuntu only)
update_motd_disable_motd_service true Disable the MOTD service (if present)
update_motd_disable_scripts 98-cloudguest List of filenames for MOTD scripts to disable

Default MOTD Scripts

Here is a list of default MOTD script names often found in Debian and Ubuntu.

Filename Releases
00-header Ubuntu 14, 16, 18, 20
10-help-text Ubuntu 14, 16, 18, 20
10-uname Debian 9, 10
50-landscape-sysinfo Ubuntu 14, 18, 20
50-motd-news Ubuntu 16, 18, 20
85-fwupd Ubuntu 20
88-esm-announce Ubuntu 16, 18, 20
90-updates-available Ubuntu 14, 16, 18
91-contract-ua-esm-status Ubuntu 16, 18, 20
91-release-upgrade Ubuntu 14, 16, 18, 20
92-unattended-upgrades Ubuntu 16, 18, 20
95-hwe-eol Ubuntu 14, 18, 20
97-overlayroot Ubuntu 14, 16, 18, 20
98-cloudguest Ubuntu 14
98-fsck-at-reboot Ubuntu 14, 16, 18, 20
98-reboot-required Ubuntu 14, 16, 18, 20

Supported Systems

Supported operating systems are:

  • Debian 9 (stretch)
  • Debian 10 (buster)
  • Debian 11 (bullseye)
  • Ubuntu 14.04 (Trusty Tahr)
  • Ubuntu 16.04 (Xenial Xerus)
  • Ubuntu 18.04 (Bionic Beaver)
  • Ubuntu 20.04 (Focal Fossa)

License

This role is licensed under the MIT License. For details, see LICENSE.

Informazioni sul progetto

Manage the dynamic MOTD on Ubuntu and Debian

Installa
ansible-galaxy install gibbs.update_motd
Licenza
mit
Download
9.8k
Proprietario