Vikas Kumar
2014-Aug-15 12:31 UTC
[Puppet Users] Restart ssh daemon when sshdconfig is modified
Dear All,
I am trying to restart SSH daemon whenever /etc/ssh/sshd_config is
modified. This is my class, it modifies the file but does not restarts the
daemon. I have tried to use both *notify* and *subscribe* in vain.
class ssh ( $ssh_service = hiera("sshservicename") ) {
package { "openssh-server": ensure => installed }
file { "/etc/ssh/sshd_config":
owner => "root",
group => "root",
# notify => Service["$ssh_service"],
}
augeas { "my-ssh":
context => "/files/etc/ssh/sshd_config",
changes => [
"set PermitRootLogin yes",
"set UsePAM yes",
"set AllowUsers root vikas"
],
}
service { "$ssh_service":
ensure => running,
enable => true,
hasrestart => true,
require => Package["openssh-server"],
subscribe => File["/etc/ssh/sshd_config"],
}
File["/etc/ssh/sshd_config"] -> Augeas["my-ssh"] ->
Service["$ssh_service"]
}
Please help me out to identify what I am missing here.
Regards,
Vikas
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/2fb05fae-6896-4c8e-9dde-a6df9e6c4388%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.