Hi, How would I do this: wgetfile { "$name-$file": url => $url, file => $file, target => $target, options => $options, before => Component["md5check-$name"] } wgetfile { "$name-$md5file": url => $url, file => $md5file, target => $target, options => $options, before => Component["md5check-$name"] } md5check { "md5check-$name": file => "$file", md5file => "$md5file", target => "$target" } I need the 2 wgetfile components to run before the md5check component so have declared the 2 wgetfile components with the before meta parameter. However, I don''t know what type to use to reference the md5check component, is there a type for this? If not, how would I achieve this? Thanks, Andrew _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Mar 12, 2007, at 5:09 PM, Andrew Leach wrote:> Hi, > > How would I do this:<..snip..>> wgetfile { "$name-$md5file": > url => $url, > file => $md5file, > target => $target, > options => $options, > before => Component["md5check-$name"] > } > > > md5check { "md5check-$name": > file => "$file", > md5file => "$md5file", > target => "$target" > } > > I need the 2 wgetfile components to run before the md5check > component so have declared the 2 wgetfile components with the > before meta parameter. However, I don''t know what type to use to > reference the md5check component, is there a type for this? If not, > how would I achieve this?before => Md5check["md5check-$name"] When you do: define md5check($foo = bar, $baz = monkey) { ... } You are automatically getting a new component declaration. Think of this in terms of having md5check "instantiating" a new instance of an md5check object. By having the capitalized "Md5check["foo"]" you are referencing that particular instance. Regards, Adam
Thanks Adam.> > before => Md5check["md5check-$name"] > > When you do: > > define md5check($foo = bar, $baz = monkey) { ... } > > You are automatically getting a new component declaration. Think of > this in terms of having md5check "instantiating" a new instance of an > md5check object. By having the capitalized "Md5check["foo"]" you are > referencing that particular instance.I''ve tried this and receive the error: Could not find type "md5check" in file ./libs/www.pp at line 56 md5check is in file "libs/security.pp" which has been imported (as well as all the other imports) in site.pp but in this case being referenced by "libs/www.pp". I believe I have a problem with the imports, even though I''ve followed the documentation. I''ve previously asked a question about this on the mailing list but haven''t yet received a solution so I might as well take the opportunity here again. The documentation says this: "If nothing appropriate is found on the MODULE_PATH, puppet will try to resolve the import relative to the directory containing the manifest doing the import." So, my understanding of this sentence is this (file contents first): file: /srv/puppet/manifests/site.pp: import "libs/www" import "libs/security" import "libs/file" import "classes/gobbledegook" node xyz { include gobbledegook } file: /srv/puppet/manifests/libs/www.pp: import "security" define wgetfile (...) { ... } define wgetfile-md5 (...) { wgetfile {....} md5check {....} } file: /srv/puppet/manifests/libs/security.pp: define md5check (...) { ... } file: /srv/puppet/manifests/classes/gobbledegook.pp define proccall (...) { wgetfile-md5 (...) { ... } } class gobbledegook { include proccall } As you can see I''ve imported everything in site.pp (as I''ve previously had problems importing elsewhere) so everything is loaded and is relatvie to that directory. What am I misunderstanding as I don''t seem to be able to get this working? Thanks for your help, Andrew _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
Ok, it seems to be a bug in the version that I was using (0.20.1), seems to be working better in the latest version. Sorry for the hassle! Regards, Andrew _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users