Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
class sshdconfig
{
        #hopefulyl this will work when we have a working user class
        #sshd_config{ puppet: authorizedusers => $engineringuserclass::engineringuserlist }

        sshd_config{ puppet: listenaddress => $ipaddress }
}

define sshd_config($listenaddress)
{
        #sshd_config refered to as alias from now on
        file { sshd_config:
                path    => $operatingsystem ? {
                        solaris => "/usr/local/etc/ssh/sshd_config",
                        debian  => "/etc/ssh/sshd_config",
                        default => "/etc/ssh/sshd_config"
                },
                owner   => root,
                group   => root,
                mode    => 444,
                content => template("sshdconfig/sshd_config.erb"),
                notify  => Service[ssh],
                alias => sshd_config,
        }

#       service { ssh:
#               name => $operatingsystem ? {
#                       fedora => "sshd",
#                       debian => "ssh",
#                       ubuntu => "ssh",
#                       default => "ssh",
#               },
#       running => true,
#       subscribe => file[sshd_config]
#       }

        service { ssh:
                running => true,
                subscribe => File[sshd_config]
        }
}


on the client i get

err: Could not retrieve catalog: Invalid parameter 'running' for type 'Service' at /etc/puppet/modules/sshdconfig/manifests/init.pp:40 on node puppetslave.sohonet.dcn.sohonet.dcn


ok ive updated the service to 
        service { ssh:
                ensure => "running",
                subscribe => File[sshd_config]
        }
}



and now i get 

err: /File[/var/lib/puppet/lib]: Failed to retrieve current state of resource: can't convert nil into String Could not describe /plugins: can't convert nil into String
info: /File[sshd_config]: Adding aliases "sshd_config"
info: Caching catalog at /var/lib/puppet/state/localconfig.yaml
notice: Starting catalog run
notice: Finished catalog run in 0.68 seconds
^Cnotice: Caught INT; shutting down
notice: Shutting down

but ssh doesnt apear to be running

cat /var/run/sshd.pid
cat: /var/run/sshd.pid: No such file or directory