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:
parent
deb967d956
commit
0a1737eb18
@ -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
modules/ssh/manifests/params.pp
Normal file
19
modules/ssh/manifests/params.pp
Normal 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).")
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user