diff --git a/manifests/init.pp b/manifests/init.pp index 2c6a54d..38b2b08 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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'], diff --git a/manifests/params.pp b/manifests/params.pp new file mode 100644 index 0000000..355bb32 --- /dev/null +++ b/manifests/params.pp @@ -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).") + } + } +}