Re: [Puppet Users] Dependency conundrum

2017-08-03 Thread Pete Brown
I found a systemd module on puppet forge which works well.
It sets up an exec to run systemd reload whenever your systemd config files
change.

https://forge.puppet.com/eyp/systemd

On Thu, 15 Jun 2017 at 14:04, Ramin K  wrote:

> Maybe I've missed something, but I don't see why your second example
> doesn't work.
>
> # Our order and notify relationships
> File['patcher-client.service'] ~> Exec['systemctl  daemon-reload']
> File['patcher-client.service'] ~> Service['patcher-client']
>
> # Our order only relationships
> Exec['systemctl  daemon-reload'] -> Service['patcher-client']
>
> Ramin
>
> On 6/15/17 7:59 AM, Tom Limoncelli wrote:
> > I'm having a problem getting some dependencies exactly right.
> >
> > This is the code I originally wrote:
> >
> >
> > File['/usr/lib/systemd/system/patcher-client.service']~>Exec['systemctl
> > daemon-reload']~>Service['patcher-client']
> >
> > It works great except... oops... if any *other* module does
> > Exec['systemctl daemon-reload'], then Service['patcher-client']
> > restarts.  That additional restart is unneeded.
> >
> > I thought about rewriting it as:
> >
> >
> > File['/usr/lib/systemd/system/patcher-client.service']~>Exec['systemctl
> > daemon-reload']
> >
> >
> File['/usr/lib/systemd/system/patcher-client.service']~>Service['patcher-client']
> >
> > But then how would Puppet know to do the Exec[] before the Service[]?  I
> > could add:
> >
> >  Exec['systemctl daemon-reload']->Service['patcher-client']
> >
> > But then we're basically in the same situation as the original code.
> Right?
> >
> > I guess I kind of want something like this: (not real syntax)
> >
> >  File['/usr/lib/systemd/system/patcher-client.service']~> (
> > Exec['systemctl daemon-reload']~>Service['patcher-client'] )
> >
> > How do I achieve that?
> >
> > Thanks in advance,
> > Tom
> >
> > --
> > Email: t...@whatexit.org Work:
> > tlimonce...@stackoverflow.com
> > Blog: http://EverythingSysadmin.com
> >
> > --
> > 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/CAHVFxgnkPQTgeNHv6L0Ao%2BuvdVtL-7ftaPfJG3gzXF0OCs6%3DsQ%40mail.gmail.com
> > <
> https://groups.google.com/d/msgid/puppet-users/CAHVFxgnkPQTgeNHv6L0Ao%2BuvdVtL-7ftaPfJG3gzXF0OCs6%3DsQ%40mail.gmail.com?utm_medium=email&utm_source=footer
> >.
> > For more options, visit 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/74f6dd1c-722f-104a-fbfc-5e3d860c0e71%40badapple.net
> .
> For more options, visit 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/CAJ8DPF6R9J9G3MgurVrT2S1Q7f%3D65Xbh2RYa3BwLnT-4y%3D1QCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Dependency conundrum

2017-06-15 Thread Ramin K
Maybe I've missed something, but I don't see why your second example 
doesn't work.


# Our order and notify relationships
File['patcher-client.service'] ~> Exec['systemctl  daemon-reload']
File['patcher-client.service'] ~> Service['patcher-client']

# Our order only relationships
Exec['systemctl  daemon-reload'] -> Service['patcher-client']

Ramin

On 6/15/17 7:59 AM, Tom Limoncelli wrote:

I'm having a problem getting some dependencies exactly right.

This is the code I originally wrote:

 
File['/usr/lib/systemd/system/patcher-client.service']~>Exec['systemctl 
daemon-reload']~>Service['patcher-client']


It works great except... oops... if any *other* module does 
Exec['systemctl daemon-reload'], then Service['patcher-client'] 
restarts.  That additional restart is unneeded.


I thought about rewriting it as:

 
File['/usr/lib/systemd/system/patcher-client.service']~>Exec['systemctl 
daemon-reload']
 
File['/usr/lib/systemd/system/patcher-client.service']~>Service['patcher-client']


But then how would Puppet know to do the Exec[] before the Service[]?  I 
could add:


 Exec['systemctl daemon-reload']->Service['patcher-client']

But then we're basically in the same situation as the original code. Right?

I guess I kind of want something like this: (not real syntax)

 File['/usr/lib/systemd/system/patcher-client.service']~> ( 
Exec['systemctl daemon-reload']~>Service['patcher-client'] )


How do I achieve that?

Thanks in advance,
Tom

--
Email: t...@whatexit.org Work: 
tlimonce...@stackoverflow.com

Blog: http://EverythingSysadmin.com

--
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/CAHVFxgnkPQTgeNHv6L0Ao%2BuvdVtL-7ftaPfJG3gzXF0OCs6%3DsQ%40mail.gmail.com 
.

For more options, visit 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/74f6dd1c-722f-104a-fbfc-5e3d860c0e71%40badapple.net.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Dependency conundrum

2017-06-15 Thread Christopher Wood
Sounds like tags and chaining, did something similar for upstart.

file { '/usr/lib/systemd/system/patcher-client.service':
  notify => Service['patcher-client'],
  tag=> ['reload systemd'],
}

File <| tag == 'reload systemd' |> ~> Exec['systemctl daemon-reload']
Exec['systemctl daemon-reload'] -> Service <| |>


Originally (on centos6 where upstart+sysvinit is combined):

class upstart {

  $upstartreload = '/sbin/initctl reload-configuration'

  exec { $upstartreload:
refreshonly => true,
  }

  File <| tag == 'upstart' |> ~> Exec[$upstartreload]
  Exec[$upstartreload] -> Service <| tag == 'upstart' |>

}



On Thu, Jun 15, 2017 at 10:59:16AM -0400, Tom Limoncelli wrote:
>I'm having a problem getting some dependencies exactly right.
>This is the code I originally wrote:
>   
>File['/usr/lib/systemd/system/patcher-client.service']~>Exec['systemctl
>daemon-reload']~>Service['patcher-client']
>It works great except... oops... if any other module does Exec['systemctl
>daemon-reload'], then Service['patcher-client'] restarts.  That additional
>restart is unneeded.
>I thought about rewriting it as:
>   
>File['/usr/lib/systemd/system/patcher-client.service']~>Exec['systemctl
>daemon-reload']
>   
>
> File['/usr/lib/systemd/system/patcher-client.service']~>Service['patcher-client']
>But then how would Puppet know to do the Exec[] before the Service[]?  I
>could add:
>    Exec['systemctl daemon-reload']->Service['patcher-client']
>But then we're basically in the same situation as the original code.
>Right?
>I guess I kind of want something like this: (not real syntax)
>    File['/usr/lib/systemd/system/patcher-client.service']~> (
>Exec['systemctl daemon-reload']~>Service['patcher-client'] )
>How do I achieve that?
>Thanks in advance,
>Tom
>--
>Email: [1]t...@whatexit.org    Work: tlimonce...@stackoverflow.com
>Blog:  [2]http://EverythingSysadmin.com
> 
>--
>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 [3]puppet-users+unsubscr...@googlegroups.com.
>To view this discussion on the web visit
>
> [4]https://groups.google.com/d/msgid/puppet-users/CAHVFxgnkPQTgeNHv6L0Ao%2BuvdVtL-7ftaPfJG3gzXF0OCs6%3DsQ%40mail.gmail.com.
>For more options, visit [5]https://groups.google.com/d/optout.
> 
> References
> 
>Visible links
>1. mailto:t...@whatexit.org
>2. http://everythingsysadmin.com/
>3. mailto:puppet-users+unsubscr...@googlegroups.com
>4. 
> https://groups.google.com/d/msgid/puppet-users/CAHVFxgnkPQTgeNHv6L0Ao%2BuvdVtL-7ftaPfJG3gzXF0OCs6%3DsQ%40mail.gmail.com?utm_medium=email&utm_source=footer
>5. 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/20170615152701.GA28982%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.


[Puppet Users] Dependency conundrum

2017-06-15 Thread Tom Limoncelli
I'm having a problem getting some dependencies exactly right.

This is the code I originally wrote:

File['/usr/lib/systemd/system/patcher-client.service']~>Exec['systemctl
daemon-reload']~>Service['patcher-client']

It works great except... oops... if any *other* module does Exec['systemctl
daemon-reload'], then Service['patcher-client'] restarts.  That additional
restart is unneeded.

I thought about rewriting it as:

File['/usr/lib/systemd/system/patcher-client.service']~>Exec['systemctl
daemon-reload']

File['/usr/lib/systemd/system/patcher-client.service']~>Service['patcher-client']

But then how would Puppet know to do the Exec[] before the Service[]?  I
could add:

Exec['systemctl daemon-reload']->Service['patcher-client']

But then we're basically in the same situation as the original code. Right?

I guess I kind of want something like this: (not real syntax)

File['/usr/lib/systemd/system/patcher-client.service']~> (
Exec['systemctl daemon-reload']~>Service['patcher-client'] )

How do I achieve that?

Thanks in advance,
Tom

-- 
Email: t...@whatexit.orgWork: tlimonce...@stackoverflow.com
Blog:  http://EverythingSysadmin.com

-- 
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/CAHVFxgnkPQTgeNHv6L0Ao%2BuvdVtL-7ftaPfJG3gzXF0OCs6%3DsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.