Update ssh module to support RHEL.

Parameterizes the ssh module so that it supports both Ubuntu and
RHEL.

Change-Id: I9163e2f41d9a25df5f757592e642073fc19001f5
Reviewed-on: https://review.openstack.org/23299
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Dan Prince 2013-03-01 11:54:55 -05:00 committed by Jenkins
parent 6039997216
commit fcfc54edea
2 changed files with 22 additions and 2 deletions

View File

@ -1,10 +1,11 @@
# == Class: ssh
#
class ssh {
package { 'openssh-server':
include ssh::params
package { $::ssh::params::package_name:
ensure => present,
}
service { 'ssh':
service { $::ssh::params::service_name:
ensure => running,
hasrestart => true,
subscribe => File['/etc/ssh/sshd_config'],

19
manifests/params.pp Normal file
View File

@ -0,0 +1,19 @@
# Class: ssh::params
#
# This class holds parameters that need to be
# accessed by other classes.
class ssh::params {
case $::osfamily {
'Redhat': {
$package_name = 'openssh-server'
$service_name = 'sshd'
}
'Debian', 'Ubuntu': {
$package_name = 'openssh-server'
$service_name = 'ssh'
}
default: {
fail("Unsupported osfamily: ${::osfamily} The 'ssh' module only supports osfamily Ubuntu or Redhat(slaves only).")
}
}
}