~taavi/vps-config

e14fa207ac4f8fccdef5dd4a050c00e6f2ae4f7c — Taavi Väänänen a month ago a257325
motd updates
M modules/profile/files/base/motd/00-header.sh => modules/profile/files/base/motd/00-header.sh +11 -5
@@ 1,8 1,14 @@
#!/bin/bash

HOSTNAME=$(hostname -f)
DISTRO=$(lsb_release -s -d)
KERNEL=$(uname -r)
DISTRO=$(lsb_release -sd)

cat <<EOF
Welcome to $HOSTNAME, running $DISTRO. 
EOF
echo "$DISTRO ($KERNEL)"

echo -en "\e[0;36m"
figlet -f slant $(hostname)
echo -en "\e[0m "

uptime -p

echo ""

M modules/profile/manifests/base/motd.pp => modules/profile/manifests/base/motd.pp +2 -0
@@ 1,5 1,7 @@
# Configures the base MOTD display
class profile::base::motd {
  ensure_packages(['figlet'])

  motd::script { 'header':
    ensure   => present,
    priority => 00,

M modules/role/manifests/bouncer.pp => modules/role/manifests/bouncer.pp +4 -0
@@ 1,5 1,9 @@
# IRC bouncer and general admin box
class role::bouncer {
  role { 'bouncer':
    description => 'IRC bouncer',
  }

  include ::profile::standard

  include ::profile::web::base

M modules/role/manifests/dns.pp => modules/role/manifests/dns.pp +4 -0
@@ 1,5 1,9 @@
# AuthDNS
class role::dns {
  role { 'dns':
    description => 'Authoritative DNS node',
  }

  include ::profile::standard
  include ::profile::dns::auth
}

A modules/role/manifests/init.pp => modules/role/manifests/init.pp +15 -0
@@ 0,0 1,15 @@
# Displays a MOTD and other appropriate things for a role
define role (
  Optional[String] $description = undef,
) {
  $real_description = $description ? {
    undef   => "role::${title}",
    default => "${description} (role::${title})",
  }

  motd::script { "role-${title}":
    ensure   => present,
    priority => 5,
    content  => template('role/motd.sh.erb'),
  }
}

M modules/role/manifests/mailserver.pp => modules/role/manifests/mailserver.pp +4 -0
@@ 1,5 1,9 @@
# Mail server
class role::mailserver {
  role { 'mailserver':
    description => 'Mail server',
  }

  include ::profile::standard
  include ::profile::mail
}

M modules/role/manifests/web.pp => modules/role/manifests/web.pp +4 -0
@@ 1,5 1,9 @@
# Web & other public services
class role::web {
  role { 'web':
    description => 'Public web server',
  }

  include ::profile::standard

  include ::profile::web::base

A modules/role/templates/motd.sh.erb => modules/role/templates/motd.sh.erb +2 -0
@@ 0,0 1,2 @@
#!/bin/sh
echo "$(hostname -f) is a <%= @real_description %>"