* Add the display of the Motd upon successful shadow login.

This commit is contained in:
gardouille 2015-02-02 18:11:30 +01:00
parent 1178ec827d
commit 91d87a60b1
4 changed files with 13 additions and 1 deletions

View File

@ -16,7 +16,7 @@
* Edit script's name: an underscore (_) in the name prevent the script to runs.
* Add a template to manage the static motd (/etc/motd).
* Rename the ::config class into ::install, because it's provide and install everything to have dynamic Motd.
* Add the display of the Motd upon successful ssh login.
* Add the display of the Motd upon successful shadow or ssh login.
---------------------------------------

View File

@ -13,7 +13,17 @@ class dynmotd::config {
],
onlyif => "match *[argument = 'motd=${dynmotd::dynmotd_path}'] size == 0",
}
}
# Need to print Motd upon successful shadow login
if $dynmotd::print_motd_login == true {
augeas { 'print_motd_login':
context => '/files/etc/pam.d/login',
changes => [
"set *[module = 'pam_motd.so']/argument motd=${dynmotd::dynmotd_path}",
],
onlyif => "match *[argument = 'motd=${dynmotd::dynmotd_path}'] size == 0",
}
}
} # Private class: dynmotd::config

View File

@ -51,6 +51,7 @@ class dynmotd (
$static_motd_path = $dynmotd::params::static_motd_path,
$static_motd_content = $dynmotd::params::static_motd_content,
$print_motd_ssh = $dynmotd::params::print_motd_ssh,
$print_motd_login = $dynmotd::params::print_motd_login,
) inherits dynmotd::params {
include dynmotd::install

View File

@ -27,6 +27,7 @@ class dynmotd::params {
# Print Motd
$print_motd_ssh = true
$print_motd_login = true
}
}