Hi all, I've been following the Puppet Pro book and trying to do a 
configuration of a ssh module like it's told in the book. I'm on Ubuntu 
10.10.

The files I have are the following:

on /etc/puppet/modules/ssh/manifests I have the config.pp  init.pp 
 install.pp  params.pp  service.pp files

they're quite small so I'm including them in the end of the post.

The problem that is happening is that if I stop the ssh service manually 
(i.e. with service ssh stop), I would like to see puppet starting the 
service again.
What I do is: stop the service, run the puppet client and wait. Nothing 
happens. I see puppet doing other things but it doesn't do anything with 
the ssh service.
Here's the relevant part of the client log. It runs with no errors.
debug: /Stage[main]/Ssh::Service/Service[ssh]/require: requires 
Class[Ssh::Config]
debug: /Stage[main]/Ssh::Config/File[/etc/ssh/sshd_config]/require: 
requires Class[Ssh::Install]
debug: /Stage[main]/Ssh::Config/File[/etc/ssh/sshd_config]/notify: 
subscribes to Class[Ssh::Service]

So I see that it recognizes my module, but it won't start the ssh service 
when I turn it down. Any help would be appreciated.





file init.pp

class ssh {
include ssh::params, ssh::install, ssh::config, ssh::service
}

file params.pp
class ssh::params {
  case $operatingsystem {
     ...
    /(Ubuntu|Debian)/: {
      $ssh_package_name = 'openssh-server'
      $ssh_service_config = '/etc/ssh/sshd_config'
      $ssh_service_name = 'ssh'
    }
  }
}

file install.pp
class ssh::install {
  package { $ssh::params::ssh_package_name:
     ensure => present,
  }
}

file config.pp

class ssh::config {
  file { $ssh::params::ssh_service_config:
    ensure => present,
    owner => 'root',
    group => 'root',
    mode  => 0644,
    source => "puppet:///modules/ssh/sshd_config",
    require => Class["ssh::install"],
    notify => Class["ssh::service"],
  }
}

file service.pp

class ssh::service {
  service { $ssh::params::ssh_service_name:
    ensure => running,
    hasstatus => true,
    hasrestart => true,
    enable => true,
    require => Class["ssh::config"]
  }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/Ruv4rv8TAgQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to