All, I have a tomcat module, and another module, containing a tomcat application called OpenAM. In the OpenAM module, I ''require'' the tomcat module, which ensures that all the tomcat bits are in place before trying to install the OpenAM bits. That works great.... except the tomcat bits includes the tomcat service. I want the OpenAM module to require the tomcat module, but I don''t want the tomcat service to start until the OpenAM module is complete. What''s the best practice way to arrange this? Doug. -- 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 suspect you may want a separate class, something like tomcat::enable to handle the service independently. On Thu, Oct 20, 2011 at 1:55 PM, Douglas Garstang <doug.garstang@gmail.com> wrote:> All, > > I have a tomcat module, and another module, containing a tomcat > application called OpenAM. In the OpenAM module, I ''require'' the > tomcat module, which ensures that all the tomcat bits are in place > before trying to install the OpenAM bits. > > That works great.... except the tomcat bits includes the tomcat > service. I want the OpenAM module to require the tomcat module, but I > don''t want the tomcat service to start until the OpenAM module is > complete. > > What''s the best practice way to arrange this? > > Doug. > > -- > 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. > >-- 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.
Douglas Garstang
2011-Oct-20 23:27 UTC
Re: [Puppet Users] Module Dependency with a service
Thanks, tried that. I moved the tomcat service out of tomcat::server into tomcat::enable, but... I had this in my tomcat::server class: File { require => Package[''apache-tomcat6''], before => Service[''tomcat''] } which now doesn''t work, because it can''t find the tomcat service. I tried this: File { require => Package[''apache-tomcat6''], before => Class[''tomcat::enable''] #Service[''tomcat''] } but puppet complains "Could not find dependent Class[Tomcat::Enable]". Any ideas? Doug. On Thu, Oct 20, 2011 at 2:46 PM, Aaron Grewell <aaron.grewell@gmail.com> wrote:> I suspect you may want a separate class, something like tomcat::enable > to handle the service independently. > > On Thu, Oct 20, 2011 at 1:55 PM, Douglas Garstang > <doug.garstang@gmail.com> wrote: >> All, >> >> I have a tomcat module, and another module, containing a tomcat >> application called OpenAM. In the OpenAM module, I ''require'' the >> tomcat module, which ensures that all the tomcat bits are in place >> before trying to install the OpenAM bits. >> >> That works great.... except the tomcat bits includes the tomcat >> service. I want the OpenAM module to require the tomcat module, but I >> don''t want the tomcat service to start until the OpenAM module is >> complete. >> >> What''s the best practice way to arrange this? >> >> Doug. >> >> -- >> 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. >> >> > > -- > 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. > >-- Regards, Douglas Garstang http://www.linkedin.com/in/garstang Email: doug.garstang@gmail.com Cell: +1-805-340-5627 -- 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 tomcat::enable is in a separate file you''ll want to ''include'' it in tomcat::server to ensure it''s in scope. On Thu, Oct 20, 2011 at 4:27 PM, Douglas Garstang <doug.garstang@gmail.com> wrote:> Thanks, tried that. I moved the tomcat service out of tomcat::server > into tomcat::enable, but... > > I had this in my tomcat::server class: > > File { > require => Package[''apache-tomcat6''], > before => Service[''tomcat''] > } > > which now doesn''t work, because it can''t find the tomcat service. I tried this: > > File { > require => Package[''apache-tomcat6''], > before => Class[''tomcat::enable''] #Service[''tomcat''] > } > > but puppet complains "Could not find dependent Class[Tomcat::Enable]". > > Any ideas? > > Doug. > > > On Thu, Oct 20, 2011 at 2:46 PM, Aaron Grewell <aaron.grewell@gmail.com> wrote: >> I suspect you may want a separate class, something like tomcat::enable >> to handle the service independently. >> >> On Thu, Oct 20, 2011 at 1:55 PM, Douglas Garstang >> <doug.garstang@gmail.com> wrote: >>> All, >>> >>> I have a tomcat module, and another module, containing a tomcat >>> application called OpenAM. In the OpenAM module, I ''require'' the >>> tomcat module, which ensures that all the tomcat bits are in place >>> before trying to install the OpenAM bits. >>> >>> That works great.... except the tomcat bits includes the tomcat >>> service. I want the OpenAM module to require the tomcat module, but I >>> don''t want the tomcat service to start until the OpenAM module is >>> complete. >>> >>> What''s the best practice way to arrange this? >>> >>> Doug. >>> >>> -- >>> 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. >>> >>> >> >> -- >> 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. >> >> > > > > -- > Regards, > > Douglas Garstang > http://www.linkedin.com/in/garstang > Email: doug.garstang@gmail.com > Cell: +1-805-340-5627 > > -- > 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. > >-- 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.
Douglas Garstang
2011-Oct-21 20:50 UTC
Re: [Puppet Users] Module Dependency with a service
Isn''t the net result of including something the same as it''s really there already? If so, the final result is the same... the service resource ends up in the tomcat::server class.... no? Doug. On Fri, Oct 21, 2011 at 10:25 AM, Aaron Grewell <aaron.grewell@gmail.com> wrote:> If tomcat::enable is in a separate file you''ll want to ''include'' it in > tomcat::server to ensure it''s in scope. > > On Thu, Oct 20, 2011 at 4:27 PM, Douglas Garstang > <doug.garstang@gmail.com> wrote: >> Thanks, tried that. I moved the tomcat service out of tomcat::server >> into tomcat::enable, but... >> >> I had this in my tomcat::server class: >> >> File { >> require => Package[''apache-tomcat6''], >> before => Service[''tomcat''] >> } >> >> which now doesn''t work, because it can''t find the tomcat service. I tried this: >> >> File { >> require => Package[''apache-tomcat6''], >> before => Class[''tomcat::enable''] #Service[''tomcat''] >> } >> >> but puppet complains "Could not find dependent Class[Tomcat::Enable]". >> >> Any ideas? >> >> Doug. >> >> >> On Thu, Oct 20, 2011 at 2:46 PM, Aaron Grewell <aaron.grewell@gmail.com> wrote: >>> I suspect you may want a separate class, something like tomcat::enable >>> to handle the service independently. >>> >>> On Thu, Oct 20, 2011 at 1:55 PM, Douglas Garstang >>> <doug.garstang@gmail.com> wrote: >>>> All, >>>> >>>> I have a tomcat module, and another module, containing a tomcat >>>> application called OpenAM. In the OpenAM module, I ''require'' the >>>> tomcat module, which ensures that all the tomcat bits are in place >>>> before trying to install the OpenAM bits. >>>> >>>> That works great.... except the tomcat bits includes the tomcat >>>> service. I want the OpenAM module to require the tomcat module, but I >>>> don''t want the tomcat service to start until the OpenAM module is >>>> complete. >>>> >>>> What''s the best practice way to arrange this? >>>> >>>> Doug. >>>> >>>> -- >>>> 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. >>>> >>>> >>> >>> -- >>> 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. >>> >>> >> >> >> >> -- >> Regards, >> >> Douglas Garstang >> http://www.linkedin.com/in/garstang >> Email: doug.garstang@gmail.com >> Cell: +1-805-340-5627 >> >> -- >> 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. >> >> > > -- > 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. > >-- Regards, Douglas Garstang http://www.linkedin.com/in/garstang Email: doug.garstang@gmail.com Cell: +1-805-340-5627 -- 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.
True. But your ''before'' already creates that dependency. Instead try using ''require'' in tomcat::enable. tomcat::enable should depend upon tomcat::server but not vice-versa in order to make this work. On Fri, Oct 21, 2011 at 1:50 PM, Douglas Garstang <doug.garstang@gmail.com> wrote:> Isn''t the net result of including something the same as it''s really > there already? If so, the final result is the same... the service > resource ends up in the tomcat::server class.... no? > > Doug. > > On Fri, Oct 21, 2011 at 10:25 AM, Aaron Grewell <aaron.grewell@gmail.com> wrote: >> If tomcat::enable is in a separate file you''ll want to ''include'' it in >> tomcat::server to ensure it''s in scope. >> >> On Thu, Oct 20, 2011 at 4:27 PM, Douglas Garstang >> <doug.garstang@gmail.com> wrote: >>> Thanks, tried that. I moved the tomcat service out of tomcat::server >>> into tomcat::enable, but... >>> >>> I had this in my tomcat::server class: >>> >>> File { >>> require => Package[''apache-tomcat6''], >>> before => Service[''tomcat''] >>> } >>> >>> which now doesn''t work, because it can''t find the tomcat service. I tried this: >>> >>> File { >>> require => Package[''apache-tomcat6''], >>> before => Class[''tomcat::enable''] #Service[''tomcat''] >>> } >>> >>> but puppet complains "Could not find dependent Class[Tomcat::Enable]". >>> >>> Any ideas? >>> >>> Doug. >>> >>> >>> On Thu, Oct 20, 2011 at 2:46 PM, Aaron Grewell <aaron.grewell@gmail.com> wrote: >>>> I suspect you may want a separate class, something like tomcat::enable >>>> to handle the service independently. >>>> >>>> On Thu, Oct 20, 2011 at 1:55 PM, Douglas Garstang >>>> <doug.garstang@gmail.com> wrote: >>>>> All, >>>>> >>>>> I have a tomcat module, and another module, containing a tomcat >>>>> application called OpenAM. In the OpenAM module, I ''require'' the >>>>> tomcat module, which ensures that all the tomcat bits are in place >>>>> before trying to install the OpenAM bits. >>>>> >>>>> That works great.... except the tomcat bits includes the tomcat >>>>> service. I want the OpenAM module to require the tomcat module, but I >>>>> don''t want the tomcat service to start until the OpenAM module is >>>>> complete. >>>>> >>>>> What''s the best practice way to arrange this? >>>>> >>>>> Doug. >>>>> >>>>> -- >>>>> 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. >>>>> >>>>> >>>> >>>> -- >>>> 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. >>>> >>>> >>> >>> >>> >>> -- >>> Regards, >>> >>> Douglas Garstang >>> http://www.linkedin.com/in/garstang >>> Email: doug.garstang@gmail.com >>> Cell: +1-805-340-5627 >>> >>> -- >>> 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. >>> >>> >> >> -- >> 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. >> >> > > > > -- > Regards, > > Douglas Garstang > http://www.linkedin.com/in/garstang > Email: doug.garstang@gmail.com > Cell: +1-805-340-5627 > > -- > 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. > >-- 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 Fri, Oct 21, 2011 at 10:25 AM, Aaron Grewell <aaron.grew...@gmail.com> wrote: > > If tomcat::enable is in a separate file you''ll want to ''include'' it in > > tomcat::server to ensure it''s in scope.On Oct 21, 3:50 pm, Douglas Garstang <doug.garst...@gmail.com> replied:> Isn''t the net result of including something the same as it''s really > there already? If so, the final result is the same... the service > resource ends up in the tomcat::server class.... no?The net result on the compiled catalog is the same, if the catalog compiles successfully, but the effect on the compilation process is not necessarily the same. I think it is an evaluation order issue. The bottom line is that you should ensure that every resource your manifests refer to is in scope (which probably means "already defined") at the point of reference, and one way to ensure a resource is in scope is to ''include'' or ''require'' the class containing it. John -- 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.