Hi I''ve created a puppet recipe that seems to not restart sshd when it''s defined. What we are trying to do is restart sshd when we add and "AllowUsers USERNAME" to sshd_config file. It doesn''t restart sshd. I''ve included only the code question... line type is one available in the wiki. define sysadmin_create ($comment,$password,$shell="/bin/bash") { group { "${title}": ensure => present, } user { "${title}": name => "${title}", gid => "${title}", ensure => present, comment => "${comment}", home => "/home/${title}", managehome => true, password => "${password}", shell => "${shell}", require => Group["${title}"], } line { "sshd_config_AllowUsers-${title}": file => "/etc/ssh/sshd_config", line => "AllowUsers ${title}", ensure => present, require => [Class["openssh-server"], User["$ {title}"] ], notify => Service["sshd"], } } class accounts { @sysadmin_create { "test": comment => "Test User", password => ''HIDDEN'', } } In the node I have: realize(Sysadmin_create["test"]) Service["sshd"] exists in another module and is: # make sure sshd is setup to run service { "sshd": name => "sshd", ensure => running, enable => true, require => Package["openssh-server"], subscribe => Package["openssh-server"], } While it creates the entry in sshd_config it does not restart the sshd?? Only this line appears: May 26 14:07:05 devcentos46 puppetd[12976]: (//Node[servername]/ accounts/Sysadmin_create[test]/Line[sshd_config_AllowUsers-test]/Exec[/ bin/echo ''AllowUsers test'' >> ''/etc/ssh/sshd_config'']/returns) executed successfully No errors or any other issue that I can determine. It appears to not execute. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On May 26, 2008, at 2:00 PM, Larry Ludwig wrote:> Hi I''ve created a puppet recipe that seems to not restart sshd when > it''s defined. What we are trying to do is restart sshd when we add > and "AllowUsers USERNAME" to sshd_config file. It doesn''t restart > sshd. > > I''ve included only the code question... line type is one available in > the wiki.I''m confident that ''notify'' is working fine. My guess is that the ''line'' resource type does not accept ''notify'', in that maybe it replaces it with another value or something. I''d confirm in your client''s cached resource catalog (at something like $vardir/localconfig.yaml) that the notify parameter is actually set. If not, track down how it''s being lost. If so, then there''s something else that''s wonky in your configuration, because this has been working stably for a long time. -- Should I say "I believe in physics", or "I know that physics is true"? -- Ludwig Wittgenstein, On Certainty, 602. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hmm it works when I move it to @sysadmin_create but not in the define. class accounts { @sysadmin_create { "test": comment => "Test User", password => ''HIDDEN'', notify => Service["sshd"], } } The code is compiling fine. I''ll have to get more down and dirty to figure out why it''s not working, could it be something related to using a define statement? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On May 26, 5:11 pm, Larry Ludwig <larry...@gmail.com> wrote:> Hmm it works when I move it to @sysadmin_create but not in the > define. > > class accounts { > @sysadmin_create { "test": > comment => "Test User", > password => ''HIDDEN'', > notify => Service["sshd"], > } > > } > > The code is compiling fine. I''ll have to get more down and dirty to > figure out why it''s not working, could it be something related to > using a define statement?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> I''m confident that ''notify'' is working fine.Hi Luke, Are you sure about this? I''ve tested this a few times and get the same result. Only touching the directadmin.conf in the example below results in a restart Here is another example: class directadmin { file { "directadmin": checksum => md5, name => "/usr/local/directadmin/directadmin", } # track directadmin.conf changes file { "directadmin.conf": checksum => md5, name => "/usr/local/directadmin/conf/ directadmin.conf", owner => ''diradmin'', group => ''diradmin'', mode => ''0600'', backup => local, require => File["directadmin"], notify => Service["directadmin"], } line {"directadmin.conf-logs_to_keep": file => "/usr/local/directadmin/conf/ directadmin.conf", line => "logs_to_keep=14", ensure => present, require => File["directadmin.conf"], notify => Service["directadmin"], } # monitor the service to ensure it''s running service { "directadmin": name => "directadmin", ensure => running, enable => true, hasrestart => true, hasstatus => true, } May 28 13:47:32 skylla puppetd[7789]: Starting Puppet client version 0.24.4 May 28 13:47:43 skylla puppetd[7789]: Starting catalog run May 28 13:47:48 skylla puppetd[7789]: (//Node[skylla]/template- directadmin/directadmin/Line[directadmin.conf-logs_to_keep]/Exec[/bin/ echo ''logs_to_keep=14'' >> ''/usr/local/directadmin/conf/ directadmin.conf'']/returns) executed successfully May 28 13:48:03 skylla puppetd[7789]: Finished catalog run in 20.84 seconds Looks like a bug to me. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> I''d confirm in your client''s cached resource catalog (at something > like $vardir/localconfig.yaml) that the notify parameter is actually > set. >I have the latest localconfig.yaml file I''m not sure how to fully read yaml and what I should be expecting (or not expecting) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It appears from what I can gather, it''s not in the localconfig.yaml for the line define. I assume it''s a define/notify bug. The code compiles fine nor does puppet or puppetmaster complain. May 28 13:51:47 puppetmasterd[16344]: Caching node skylla May 28 13:51:48 puppetmasterd[16344]: Compiled configuration for skylla in 1.24 seconds which matches: -rw-r----- 1 root root 214867 May 28 13:51 localconfig.yaml So if it''s not a supported feature then it''s not complaining about it. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On May 28, 2008, at 12:04 PM, Larry Ludwig wrote:> > It appears from what I can gather, it''s not in the localconfig.yaml > for the line define. I assume it''s a define/notify bug. The code > compiles fine nor does puppet or puppetmaster complain. > > May 28 13:51:47 puppetmasterd[16344]: Caching node skylla > May 28 13:51:48 puppetmasterd[16344]: Compiled configuration for > skylla in 1.24 seconds > > which matches: > -rw-r----- 1 root root 214867 May 28 13:51 localconfig.yaml > > So if it''s not a supported feature then it''s not complaining about it.If it''s not in the local config, then something in your configuration is replacing or removing the setting during compilation. -- The most overlooked advantage to owning a computer is that if they foul up there''s no law against wacking them around a little. -- Joe Martin --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> If it''s not in the local config, then something in your configuration > is replacing or removing the setting during compilation.Ok how can this be? I do not inherit this class, is ''include''d in the a node, and do not have a definition ''service'' or ''line'' type anywhere else. Thanks.. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---