diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-04-05 07:41:56 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-04-05 07:41:56 +0000 |
commit | ccb78ad309d36e9f68983330ed02698b8a5d0666 (patch) | |
tree | e55dba58ab80b7dc1adffe5c48113cdc08b415f3 /manifests/profile/base | |
parent | 916529214db76aed755876093b34b38bba78b9fb (diff) | |
parent | b35bc80ac2acf18463e4c18c8360862749aa0964 (diff) |
Merge "SSHD Service extensions"
Diffstat (limited to 'manifests/profile/base')
-rw-r--r-- | manifests/profile/base/sshd.pp | 56 |
1 files changed, 27 insertions, 29 deletions
diff --git a/manifests/profile/base/sshd.pp b/manifests/profile/base/sshd.pp index e7916c1..f43089c 100644 --- a/manifests/profile/base/sshd.pp +++ b/manifests/profile/base/sshd.pp @@ -15,47 +15,45 @@ # # == Class: tripleo::profile::base::sshd # -# SSH profile for tripleo +# SSH composable service for TripleO # # === Parameters # # [*bannertext*] -# The text used within SSH Banner +# The text used within /etc/issue and /etc/issue.net # Defaults to hiera('BannerText') # +# [*motd*] +# The text used within SSH Banner +# Defaults to hiera('MOTD') +# class tripleo::profile::base::sshd ( $bannertext = hiera('BannerText', undef), + $motd = hiera('MOTD', undef), ) { - if $bannertext { - $action = 'set' - } else { - $action = 'rm' - } - - package {'openssh-server': - ensure => installed, - } + include ::ssh - augeas { 'sshd_config_banner': - context => '/files/etc/ssh/sshd_config', - changes => [ "${action} Banner /etc/issue" ], - notify => Service['sshd'] - } - - file { '/etc/issue': - ensure => file, - backup => false, - content => $bannertext, - owner => 'root', - group => 'root', - mode => '0600' + if $bannertext { + $filelist = [ '/etc/issue', '/etc/issue.net', ] + file { $filelist: + ensure => file, + backup => false, + content => $bannertext, + owner => 'root', + group => 'root', + mode => '0644' + } } - service { 'sshd': - ensure => 'running', - enable => true, - hasstatus => false, - require => Package['openssh-server'], + if $motd { + file { '/etc/motd': + ensure => file, + backup => false, + content => $motd, + owner => 'root', + group => 'root', + mode => '0644' + } } } |