hello,

----- "Martijn Grendelman" <mart...@grendelman.net> wrote:

> Hi,
> 
> I have create the following module:
> 
> modules/foo
> `-- manifests
>     |-- definitions
>     |   `-- line.pp
>     `-- init.pp
> 
> $ cat modules/foo/manifests/init.pp
> import "definitions/*.pp"
> 
> $ cat modules/foo/manifests/definitions/line.pp
> define myline($file, $line, $ensure = 'present') {
>     ....
> }
> 
> I try to use the definition in a class:
> 
> class testfile {
> 
>     file { "/tmp/testfile":
>         ensure => present,
>     }
> 
>     myline { test:
>         file => "/tmp/testfile",
>         line => "# This is a test",
>         ensure => present,
>     }
> }

You define should be:

define foo::myline { .... }

and it should be in modules/foo/manifests/myline.pp


> Is the way I am trying to do things supposed to work?

nope,

> What is the reason that this doesn't work? Is it an issue with loading
> order?
> 
> How can I ensure that the module is loaded/available before the
> 'testfile' class is evaluated?

name the files as documented.  The puppet master will not know to find your 
file in a weird location in a file not even called the same as the define, you 
can help it by just sticking to the way puppet is designed[1] to work, and then 
it will work.

[1] http://docs.reductivelabs.com/guides/modules.html

-- 
R.I.Pienaar

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to