Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- class ssh {
- # libdir changes base on arch
- if $architecture == "x86_64" { $lib_dir = "lib64" }
- else { $lib_dir = "lib" }
- # different package based on distro
- package { "ssh":
- name => $operatingsystem ? {
- OpenSuSE => "openssh",
- RedHat => [ "openssh", "openssh-clients", "openssh-server" ]
- },
- ensure => installed
- }
- #
- define sshd_config (
- $allowgroups = "",
- $allowusers = "",
- $subsystem = $operatingsystem ? {
- OpenSuSE => "Subsystem sftp /usr/$lib_dir/ssh/sftp-server -l INFO",
- RedHat => "Subsystem sftp /usr/libexec/openssh/sftp-server -l INFO",
- }
- ) {
- file { "sshd_config":
- name => "/etc/ssh/sshd_config",
- ensure => file,
- mode => 640,
- owner => root,
- group => root,
- content => template("ssh/sshd_config.erb"),
- require => Package["ssh"],
- #notify => Service["sshd"]
- }
- }
- #
- service { "sshd":
- enable => true,
- ensure => running,
- hasrestart => true,
- hasstatus => true,
- subscribe => File[ "sshd_config" ],
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment