From 3175d02e42583a97f8fb2a529ee129ba5270c945 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Mon, 2 Feb 2015 11:23:17 +0100 Subject: [PATCH] * Create the "update-motd.d" to use the dynamic MOTD generation. --- CHANGELOG.md | 1 + manifests/config.pp | 7 +++++++ manifests/init.pp | 1 + manifests/params.pp | 4 ++++ 4 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68587a9..ccf75a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ##### Changes * Update dynmotd script (new process and sockets informations). +* Create the "update-motd.d" to use the dynamic MOTD generation. --------------------------------------- diff --git a/manifests/config.pp b/manifests/config.pp index 79f8246..d120754 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -10,10 +10,17 @@ class dynmotd::config { mode => 0644, } + file { "${dynmotd::update_motd_dir_path}": + ensure => directory, + } + file { "${dynmotd::dynmotd_bin_path}": ensure => present, mode => 0755, content => template("${dynmotd::dynmotd_bin_content}"), } + + File["${dynmotd::update_motd_dir_path}"] -> File["${dynmotd::dynmotd_bin_path}"] + } # Private class: dynmotd::config diff --git a/manifests/init.pp b/manifests/init.pp index bd9eb86..e7a43a3 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -38,6 +38,7 @@ class dynmotd ( $dynmotd_bin_path = $dynmotd::params::dynmotd_bin_path, $dynmotd_bin_content = $dynmotd::params::dynmotd_bin_content, + $update_motd_dir_path = $dynmotd::params::update_motd_dir_path, ) inherits dynmotd::params { include dynmotd::config diff --git a/manifests/params.pp b/manifests/params.pp index 9f24d12..069d6eb 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -4,11 +4,15 @@ class dynmotd::params { case $::osfamily { 'Debian': { + # Dynamic Motd's script directory + $update_motd_dir_path = '/etc/update-motd.d' + # DynMotd script $dynmotd_bin_path = '/usr/local/bin/dynmotd' $dynmotd_bin_content = 'dynmotd/dynmotd_bin.erb' + } } } # Private class: dynmotd::params