Merge branch 'ferm'
[mirror/dsa-puppet.git] / modules / ssh / manifests / init.pp
1 class ssh {
2         package {
3                 openssh-client: ensure => installed;
4                 openssh-server: ensure => installed;
5         }
6
7         case $hostname {
8                 bartok: {
9                     $keyinfo = allnodeinfo("sshRSAHostKey", "ipHostNumber")
10                 }
11         }
12
13
14         file { "/etc/ssh/ssh_config":
15                 source  => [ "puppet:///ssh/ssh_config" ],
16                 require => Package["openssh-client"]
17                 ;
18                "/etc/ssh/sshd_config":
19                 content => template("ssh/sshd_config.erb"),
20                 require => Package["openssh-server"],
21                 notify  => Exec["ssh restart"]
22                 ;
23               "/etc/ssh/userkeys":
24                 ensure  => directory,
25                 owner   => root,
26                 group   => root,
27                 mode    => 755,
28                 ;
29               "/etc/ssh/userkeys/root":
30                 content => template("ssh/authorized_keys.erb"),
31                 mode    => 444,
32                 require => Package["openssh-server"]
33                 ;
34         }
35
36         exec { "ssh restart":
37             path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
38             refreshonly => true,
39         }
40         ferm::rule { "dsa-ssh":
41                 description     => "Allow SSH",
42                 rule            => "proto tcp dport ssh ACCEPT",
43                 domain          => "(ip ip6)",
44                 prio            => "01"
45         }
46
47 }