I am looking for a way to create a dependency that ensures that a definition has been "called/executed/instantiated" with the "require" or "before" parameter. I realize there are several posts that confirm that this should be possible: define testdef { } file { "testFile": name => "/tmp/testFile", require => Testdef["test"] } However when I attempt to run it I get this: err: Could not run Puppet configuration client: Could not find dependency Testmodule::Testdef[test] for File[testFile] at /etc/puppet/ modules/testmodule/manifests/init.pp:33 -- 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 3/17/2010 12:59 AM, Mike wrote:> I am looking for a way to create a dependency that ensures that a > definition has been "called/executed/instantiated" with the "require" > or "before" parameter. > I realize there are several posts that confirm that this should be > possible: > > define testdef { > } > > file { "testFile": > name => "/tmp/testFile", > require => Testdef["test"] > } > > > However when I attempt to run it I get this: > err: Could not run Puppet configuration client: Could not find > dependency Testmodule::Testdef[test] for File[testFile] at /etc/puppet/ > modules/testmodule/manifests/init.pp:33 >The error should vanish as soon as you add this: testdef { "test: } Regards, David -- dasz.at OG Tel: +43 (0)664 2602670 Web: http://dasz.at Klosterneuburg UID: ATU64260999 FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg -- 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.
Thanks. That was what I was missing. So apparently you need to "call" a definition before you can require it. On Mar 17, 4:57 am, David Schmitt <da...@dasz.at> wrote:> On 3/17/2010 12:59 AM, Mike wrote: > > > > > > > I am looking for a way to create a dependency that ensures that a > > definition has been "called/executed/instantiated" with the "require" > > or "before" parameter. > > I realize there are several posts that confirm that this should be > > possible: > > > define testdef { > > } > > > file { "testFile": > > name => "/tmp/testFile", > > require => Testdef["test"] > > } > > > However when I attempt to run it I get this: > > err: Could not run Puppet configuration client: Could not find > > dependency Testmodule::Testdef[test] for File[testFile] at /etc/puppet/ > > modules/testmodule/manifests/init.pp:33 > > The error should vanish as soon as you add this: > > testdef { "test: } > > Regards, David > -- > dasz.at OG Tel: +43 (0)664 2602670 Web:http://dasz.at > Klosterneuburg UID: ATU64260999 > > FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg-- 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 3/17/2010 3:56 PM, Mike wrote:> Thanks. That was what I was missing. So apparently you need to "call" > a definition before you can require it.Almost. The proper wording of that statement would be: "You need to *manage* a *resource*, before you can require it." Regards, David -- dasz.at OG Tel: +43 (0)664 2602670 Web: http://dasz.at Klosterneuburg UID: ATU64260999 FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg -- 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.
Makes sense now. Got confused with definitions for some reason. Thanks again. On Mar 17, 9:32 am, David Schmitt <da...@dasz.at> wrote:> On 3/17/2010 3:56 PM, Mike wrote: > > > Thanks. That was what I was missing. So apparently you need to "call" > > a definition before you can require it. > > Almost. The proper wording of that statement would be: "You need to > *manage* a *resource*, before you can require it." > > Regards, David > -- > dasz.at OG Tel: +43 (0)664 2602670 Web:http://dasz.at > Klosterneuburg UID: ATU64260999 > > FB-Nr.: FN 309285 g FB-Gericht: LG Korneuburg-- 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.