From 2168a5cb51c9e67bbf89883713b88b023d2a0d1d Mon Sep 17 00:00:00 2001 From: okopop Date: Sat, 30 Nov 2024 18:41:54 +0100 Subject: [PATCH] Udate README to best practice layout --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++---------- metadata.json | 2 +- 2 files changed, 45 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0cf3df1..a304133 100644 --- a/README.md +++ b/README.md @@ -3,32 +3,59 @@ [![Puppet Forge quality score](https://img.shields.io/puppetforge/qualityscore/okopop/motd)](https://forge.puppet.com/modules/okopop/motd) [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/okopop/puppet-motd/pdk.yml)](https://github.com/okopop/puppet-motd/actions/workflows/pdk.yml) +# motd +#### Table of Contents -# motd -Template based /etc/motd which shows only the most crucial info about the server. -The ambition is to keep this module simple but relevant and not add values that change often. -I have not tested on all different distros myself but should work if you have normal facter values and the uptime --since command. -Feel free to contribute! +1. [Overview](#overview) +1. [Module Description](#module-description) +1. [Setup - The basics of getting started](#setup) +1. [Usage - Configuration options](#usage) +1. [Example output](#example) +1. [Development - Guide for contributing to the module](#development) + +## Overview + +This module creates a /etc/motd file. +It shows the most relevant info about the server by default and you can add your own +messages as either Information or WARNING when needed. + +## Module description + +This module is templated based and does the following: - Show a simple server summary. -- Add custom server information with hiera. +- Add information message with hiera. - Add warning message with hiera, when you want to get an important message out to the users that log in. -- 'Last reboot' is a more static value than showing number of days uptime, which create unnecessary change noise everyday. -The value could be used to get a hint when a server most likely got updated and rebooted, or if the server is forgotten because of high uptime and need some attention. +- Show when server was last rebooted. The value 'Last reboot' is very static and is a better option than showing uptime in days, which create unnecessary change noise every day. +The value could be used to get a hint when a server most likely was patched and rebooted, or if the server is forgotten because of high uptime and need some attention. + +## Setup -## Hiera example +Any of these will include motd to the catalog and create the /etc/motd file with default values from facts. + +```puppet +include motd + +``` +or hiera ```yaml --- classes: - motd +``` + +## Usage + +Add your own messages with hiera to be displayed in /etc/motd +```yaml motd::info: "Product X | Production | Team Y" motd::warn: "This OS version is EOL since XX-YY-ZZ" ``` -## Motd example +## Example ``` ================== Motd by Puppet ============================== @@ -41,3 +68,10 @@ Information......: Product X | Production | Team Y WARNING..........: This OS version is EOL since XX-YY-ZZ ================================================================ ``` + +## Development + +The ambition is to keep the motd file short and simple and not add values that change often. +I have not tested on all different distros myself but should work if you have normal fact values. + +Feel free to contribute with ideas! diff --git a/metadata.json b/metadata.json index 897612f..73cee46 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "okopop-motd", - "version": "1.1.3", + "version": "1.1.4", "author": "okopop", "summary": "Template based /etc/motd which shows only the most crucial info about the server.", "license": "Apache-2.0",