From b81600aef8d0cb160edb387a2fc62a67c1bf3972 Mon Sep 17 00:00:00 2001 From: Jeltz Date: Sat, 6 Mar 2021 04:31:20 +0100 Subject: [PATCH] Use 'update_motd' in 'baseconfig' --- roles/baseconfig/files/update-motd.d/00-logo | 39 ------------------- roles/baseconfig/files/update-motd.d/10-uname | 3 -- roles/baseconfig/tasks/main.yml | 11 +----- 3 files changed, 2 insertions(+), 51 deletions(-) delete mode 100755 roles/baseconfig/files/update-motd.d/00-logo delete mode 100755 roles/baseconfig/files/update-motd.d/10-uname diff --git a/roles/baseconfig/files/update-motd.d/00-logo b/roles/baseconfig/files/update-motd.d/00-logo deleted file mode 100755 index 025257f..0000000 --- a/roles/baseconfig/files/update-motd.d/00-logo +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# {{ ansible_managed }} - -# Pretty uptime -upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)" -mins=$((${upSeconds}/60%60)) -hours=$((${upSeconds}/3600%24)) -days=$((${upSeconds}/86400)) -UPTIME=`printf "%d jours, %02dh%02dm" "$days" "$hours" "$mins"` - -# RAM -RAM=`free -m | awk 'NR==2{printf "%s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }'` -DISK=`df -h | awk '$NF=="/"{printf "%d/%dGB (%s)\n", $3,$2,$5}'` - -# Text font -bold=$(tput bold) -normal=$(tput sgr0) - -# Logo -cat << EOF - -      ${bold}Uptime${normal} : ${UPTIME} -    ${bold}Mémoire${normal} : ${RAM} -        ${bold}Disque racine${normal} : ${DISK} -        -           -            -           -           -        -        -          -          -          -            -         -   ${bold}Aurore${normal}     - -EOF diff --git a/roles/baseconfig/files/update-motd.d/10-uname b/roles/baseconfig/files/update-motd.d/10-uname deleted file mode 100755 index 4586095..0000000 --- a/roles/baseconfig/files/update-motd.d/10-uname +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -# {{ ansible_managed }} -uname -snrvm diff --git a/roles/baseconfig/tasks/main.yml b/roles/baseconfig/tasks/main.yml index 0c13978..04492c3 100644 --- a/roles/baseconfig/tasks/main.yml +++ b/roles/baseconfig/tasks/main.yml @@ -32,15 +32,8 @@ retries: 3 until: apt_result is succeeded -# Pimp my server -- name: Customize motd - copy: - src: "update-motd.d/{{ item }}" - dest: "/etc/update-motd.d/{{ item }}" - mode: 0755 - loop: - - 00-logo - - 10-uname +- include_role: + name: update_motd - name: Remove Debian warranty motd file: