Re: [Puppet Users] Use the same resource in two dependent classes

2014-02-18 Thread jcbollinger
On Tuesday, February 18, 2014 6:25:43 AM UTC-6, zerozer...@gmail.com wrote: > > On Tuesday, February 18, 2014 1:11:15 PM UTC+1, nikolavp wrote: > > >> class A { >> service {'myservice': >> ensure => 'started', >> } >> >> file { '/etc/default/myservice.conf': >>

Re: [Puppet Users] Use the same resource in two dependent classes

2014-02-18 Thread Nikola Petrov
On Tue, Feb 18, 2014 at 04:25:43AM -0800, zerozerouno...@gmail.com wrote: > On Tuesday, February 18, 2014 1:11:15 PM UTC+1, nikolavp wrote: > > > > class A { > > service {'myservice': > > ensure => 'started', > > } > > > > file { '/etc/default/myservice.conf': > >

Re: [Puppet Users] Use the same resource in two dependent classes

2014-02-18 Thread zerozerounouno
On Tuesday, February 18, 2014 1:18:36 PM UTC+1, Felix.Frank wrote: > Can the service be moved to a class of its own, which is included and > notified by both A and B? > Indeed, maybe this is a clean and viable solution. I'll look into it. Thanks. -- You received this message because you are

Re: [Puppet Users] Use the same resource in two dependent classes

2014-02-18 Thread zerozerounouno
On Tuesday, February 18, 2014 1:11:15 PM UTC+1, nikolavp wrote: > class A { > service {'myservice': > ensure => 'started', > } > > file { '/etc/default/myservice.conf': > ensure => present, > notify => Service['myservice'], > template => '...',

Re: [Puppet Users] Use the same resource in two dependent classes

2014-02-18 Thread Felix Frank
Hi, On 02/17/2014 12:41 PM, zerozerouno...@gmail.com wrote: > resources belonging to class B must be applied only after resources from > class A have been applied. Class B also contains some File resources, > and after they are applied also the _same_ service from class A needs to > be restarted.

Re: [Puppet Users] Use the same resource in two dependent classes

2014-02-18 Thread Nikola Petrov
Hi Marco, On Mon, Feb 17, 2014 at 03:41:14AM -0800, zerozerouno...@gmail.com wrote: > Hi, > I have this situation: > > Class A: contains a File resource, and a Service resource which requires > the File resource (the service needs to be restarted when the file changes). > > Class B: will be app

Re: [Puppet Users] Use the same resource in two dependent classes

2014-02-18 Thread zerozerounouno
On Monday, February 17, 2014 9:40:22 PM UTC+1, Trevor Vaughan wrote: Can you just have Class B 'include' class A and then have the appropriate > resources in Class B notify/require what you need from Class A? > Wouldn't this create a dependency cycle? Class B, as I wrote, "requires" class A. I

Re: [Puppet Users] Use the same resource in two dependent classes

2014-02-17 Thread Trevor Vaughan
Can you just have Class B 'include' class A and then have the appropriate resources in Class B notify/require what you need from Class A? If not, then you might need a Class C that provides the glue code using the relationship operators (->, ~>, etc...). Trevor On Mon, Feb 17, 2014 at 6:41 AM,