Hello, I''ve got a module with an ''init.pp'' like so: class test_backend { ... exec {''reset'': refreshonly => true, command => ''C:\blah.exe'', } ... } And I declare a defined resource type ''cmd.pp'' below: define test_backend::cmd($var1, $var2) { ... file {''$var1'': ensure => file, content => $var2, notify => Test_backend::Exec[''reset''], } ... } And this is what I get: Failed to apply catalog: Could not find dependent Test_backend::Exec[reset] for File[bobloblaw] How should I go about doing this? Thanks, Reginald -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/yT8Di-tnAysJ. 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 Monday, December 10, 2012 3:36:55 PM UTC-6, Reginald Choudari wrote:> > Hello, > > I''ve got a module with an ''init.pp'' like so: > > class test_backend { > > ... > > exec {''reset'': > > refreshonly => true, > > command => ''C:\blah.exe'', > > } > > ... > > } > > > And I declare a defined resource type ''cmd.pp'' below: > > > define test_backend::cmd($var1, $var2) { > > ... > > file {''$var1'': > > ensure => file, > > content => $var2, > > notify => Test_backend::Exec[''reset''], > > } > > ... > > } > > > And this is what I get: > > Failed to apply catalog: Could not find dependent > Test_backend::Exec[reset] for File[bobloblaw] > > >Did you "include test_backend" or "class { ''test_backend'': }" anywhere?> How should I go about doing this? > > Thanks, > Reginald > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/GJMB5Ex6msoJ. 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.
In the defined type, no I did not. Is that required for a defined typed declared as a child of the class''s scope? On Monday, December 10, 2012 4:39:57 PM UTC-5, llowder wrote:> > > > On Monday, December 10, 2012 3:36:55 PM UTC-6, Reginald Choudari wrote: >> >> Hello, >> >> I''ve got a module with an ''init.pp'' like so: >> >> class test_backend { >> >> ... >> >> exec {''reset'': >> >> refreshonly => true, >> >> command => ''C:\blah.exe'', >> >> } >> >> ... >> >> } >> >> >> And I declare a defined resource type ''cmd.pp'' below: >> >> >> define test_backend::cmd($var1, $var2) { >> >> ... >> >> file {''$var1'': >> >> ensure => file, >> >> content => $var2, >> >> notify => Test_backend::Exec[''reset''], >> >> } >> >> ... >> >> } >> >> >> And this is what I get: >> >> Failed to apply catalog: Could not find dependent >> Test_backend::Exec[reset] for File[bobloblaw] >> >> >> > Did you "include test_backend" or "class { ''test_backend'': }" anywhere? > > > >> How should I go about doing this? >> >> Thanks, >> Reginald >> >> >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/ps7--_wD5xMJ. 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 Monday, December 10, 2012 3:47:21 PM UTC-6, Reginald Choudari wrote:> > In the defined type, no I did not. Is that required for a defined typed > declared as a child of the class''s scope? >If you want to notify some resource, it has to be included in that catalog somewhere. So either in that define, or your node def from the ENC, you will have to also include that class.> > On Monday, December 10, 2012 4:39:57 PM UTC-5, llowder wrote: >> >> >> >> On Monday, December 10, 2012 3:36:55 PM UTC-6, Reginald Choudari wrote: >>> >>> Hello, >>> >>> I''ve got a module with an ''init.pp'' like so: >>> >>> class test_backend { >>> >>> ... >>> >>> exec {''reset'': >>> >>> refreshonly => true, >>> >>> command => ''C:\blah.exe'', >>> >>> } >>> >>> ... >>> >>> } >>> >>> >>> And I declare a defined resource type ''cmd.pp'' below: >>> >>> >>> define test_backend::cmd($var1, $var2) { >>> >>> ... >>> >>> file {''$var1'': >>> >>> ensure => file, >>> >>> content => $var2, >>> >>> notify => Test_backend::Exec[''reset''], >>> >>> } >>> >>> ... >>> >>> } >>> >>> >>> And this is what I get: >>> >>> Failed to apply catalog: Could not find dependent >>> Test_backend::Exec[reset] for File[bobloblaw] >>> >>> >>> >> Did you "include test_backend" or "class { ''test_backend'': }" anywhere? >> >> >> >>> How should I go about doing this? >>> >>> Thanks, >>> Reginald >>> >>> >>-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/z2NH9d7rsDkJ. 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 Monday, December 10, 2012 4:14:34 PM UTC-6, llowder wrote:> > > > On Monday, December 10, 2012 3:47:21 PM UTC-6, Reginald Choudari wrote: >> >> In the defined type, no I did not. Is that required for a defined typed >> declared as a child of the class''s scope? >> > > If you want to notify some resource, it has to be included in that catalog > somewhere. So either in that define, or your node def from the ENC, you > will have to also include that class. >Yes. That the type definition''s name is in the namespace of class ''test_backend'' does not automagically cause that class to be assigned to nodes for which instances of the defined type are declared. There doesn''t even have to be such a class. Since there is a class ''test_backend'' and it is not parametrized, it is safe and preferable to "include ''test_backend''" at the beginning of the body of every other class or type definition that refers to its variables or to any resource it declares. That *does* assign the class to nodes. It is safe for such an ''include'' statement to be processed multiple times, but the same is not true of the "class { ''test_backend'': ... }" form. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/XWBPzJsbYCEJ. 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.