mirror of
https://github.com/Adam-Ant/puppet-motd
synced 2025-06-23 01:40:55 +00:00
Initial Commit
This commit is contained in:
31
manifests/init.pp
Normal file
31
manifests/init.pp
Normal file
@ -0,0 +1,31 @@
|
||||
# Class: motd
|
||||
# ===========================
|
||||
#
|
||||
# Install a standardized motd across all your nodes.
|
||||
#
|
||||
#
|
||||
# Examples
|
||||
# --------
|
||||
#
|
||||
# @example
|
||||
# include ::motd
|
||||
#
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# Adam Dodman <hello@adam-ant.co.uk>
|
||||
#
|
||||
# Copyright
|
||||
# ---------
|
||||
#
|
||||
# Copyright 2018 Adam Dodman, unless otherwise noted.
|
||||
#
|
||||
class motd {
|
||||
$motd_hash = {
|
||||
'ascii' => generate('/bin/sh', '-c', "/usr/bin/figlet -cw 60 ${$facts['networking']['hostname']}"),
|
||||
}
|
||||
|
||||
file { '/etc/motd':
|
||||
content => epp('motd/motd.epp', $motd_hash),
|
||||
}
|
||||
}
|
19
manifests/install.pp
Normal file
19
manifests/install.pp
Normal file
@ -0,0 +1,19 @@
|
||||
# This manifest is used to install figlet, required by the motd package.
|
||||
# It should only be required on the puppet master.
|
||||
|
||||
class motd::install {
|
||||
if $facts['os']['family'] == 'Redhat' {
|
||||
include repoforge
|
||||
|
||||
package { 'figlet':
|
||||
ensure => present,
|
||||
require => Yumrepo['rpmforge'],
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
package { 'figlet':
|
||||
ensure => present,
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user