Created
June 30, 2014 13:53
-
-
Save WhatsARanjit/dcc4a656e8643c9bb90d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MASTER | |
class ssh::install { | |
package { $ssh::params::ssh_packages : | |
ensure => installed, | |
} | |
} | |
class ssh::config { | |
file { '/etc/ssh/sshd_config': | |
ensure => present, | |
owner => 'root', | |
group => 'root', | |
mode => '0600', | |
source => "puppet://$puppetserver/modules/ssh/sshd_config", | |
} | |
} | |
class ssh::service { | |
service { 'sshd': | |
name => $operatingsystem ? { | |
centos => 'sshd', | |
ubuntu => 'ssh', | |
default => 'ssh', | |
}, | |
ensure => running, | |
enable => true, | |
} | |
} | |
class ssh::params { | |
case $operatingsystem { | |
'CentOS': { | |
$ssh_packages = [ 'openssh', 'openssh-server', 'openssh-clients' ] | |
} | |
'ubuntu': { | |
$ssh_packages = [ 'openssh-server', 'openssh-client' ] | |
} | |
default: { | |
fail("Login class does not work on opeating system: $operatingsystem") | |
} | |
} | |
} | |
class ssh { | |
class { 'ssh::params': } -> | |
class { 'ssh::install': } -> | |
class { 'ssh::config': } ~> | |
class { 'ssh::service': } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment