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 puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Are you trying to start ''ssh'' or ''sshd'' as a service ( you have $ssh_service_name = ''ssh'' in your params class)? On Fri, Mar 16, 2012 at 12:23 AM, Luis Festas Matos <lufebbp@gmail.com>wrote:> 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 puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- Gary Larizza Professional Services Engineer Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Hi Gary, I''m trying to start sshd. But the command to start sshd is "service ssh start" at least on the prompt line. If I change it to ''sshd'' on the params class it gives me the following error: err: /Stage[main]/Ssh::Service/Service[sshd]: Could not evaluate: Could not find init script for ''sshd'' No matter if sshd is working or not, with ''ssh'' on the params class nothing happens. The running sshd service has the following ps -ef : root 27607 1 0 20:53 ? 00:00:00 /usr/sbin/sshd -D Thanks for your help :) On Thursday, March 15, 2012 9:51:44 PM UTC+1, Gary Larizza wrote:> > Are you trying to start ''ssh'' or ''sshd'' as a service ( you > have $ssh_service_name = ''ssh'' in your params class)? > > >-- 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/-/tRrPcv1mZIIJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Yep, Forgot that Ubuntu uses ''ssh'' whereas CentOS uses ''sshd''. Have you seen this bug --> https://projects.puppetlabs.com/issues/12773 May be appropriate here. -Gary On Fri, Mar 16, 2012 at 8:09 PM, Luis Festas Matos <lufebbp@gmail.com>wrote:> Hi Gary, > > I''m trying to start sshd. But the command to start sshd is "service ssh > start" at least on the prompt line. > If I change it to ''sshd'' on the params class it gives me the following > error: > > err: /Stage[main]/Ssh::Service/Service[sshd]: Could not evaluate: Could > not find init script for ''sshd'' > > No matter if sshd is working or not, with ''ssh'' on the params class > nothing happens. The running sshd service has the following ps -ef : > > root 27607 1 0 20:53 ? 00:00:00 /usr/sbin/sshd -D > > Thanks for your help :) > > > On Thursday, March 15, 2012 9:51:44 PM UTC+1, Gary Larizza wrote: >> >> Are you trying to start ''ssh'' or ''sshd'' as a service ( you >> have $ssh_service_name = ''ssh'' in your params class)? >> >> >> -- > 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/-/tRrPcv1mZIIJ. > > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- Gary Larizza Professional Services Engineer Puppet Labs -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.