Could also go for:

File["/etc/ssh/sshd_config"] -> Augeas["my-ssh"]
File["/etc/ssh/sshd_config"] ~> Service["$ssh_service"]
Augeas["my-ssh"] ~> Service["$ssh_service"]

A bit wordier but it covers what happens when the file is changed but augeas 
has nothing to change.

Vikas, perhaps you might use a template instead of augeas? That way you could 
have the standard package->file->service set of relationships and a single 
source for the content in your sshd_config.

https://docs.puppetlabs.com/learning/templates.html
https://docs.puppetlabs.com/guides/templating.html

On Fri, Aug 15, 2014 at 07:52:15AM -0500, Jeffrey Watts wrote:
>    On Fri, Aug 15, 2014 at 7:31 AM, Vikas Kumar <[1]vikas...@gmail.com>
>    wrote:
> 
>      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.
> 
>    Change your subscribe line to Augeas["my-ssh"].
>    Good luck,
>    Jeffrey.
> 
>    --
>    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 [2]puppet-users+unsubscr...@googlegroups.com.
>    To view this discussion on the web visit
>    
> [3]https://groups.google.com/d/msgid/puppet-users/CAMvPdm1i%2BxXj54W-8rBTw5mRXmnQtCzd7sZF7%2B9mzePdcjMAsQ%40mail.gmail.com.
>    For more options, visit [4]https://groups.google.com/d/optout.
> 
> References
> 
>    Visible links
>    1. mailto:vikas...@gmail.com
>    2. mailto:puppet-users+unsubscr...@googlegroups.com
>    3. 
> https://groups.google.com/d/msgid/puppet-users/CAMvPdm1i%2BxXj54W-8rBTw5mRXmnQtCzd7sZF7%2B9mzePdcjMAsQ%40mail.gmail.com?utm_medium=email&utm_source=footer
>    4. https://groups.google.com/d/optout

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/20140815135407.GA2411%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.

Reply via email to