On Fri, Oct 14, 2011 at 5:20 AM, Rob Sweet <rhsw...@gmail.com> wrote:
> It looks like you're passing in the path parameter but not using it
> within your file declaration inside the define. Without a path, Puppet
> needs the name parameter to have a full path. Add 'path => $path' to
> your file resource and see if that gets you working.
>
> Rob
>
> On Oct 14, 12:19 am, CraftyTech <hmmed...@gmail.com> wrote:
>> This is the whole file:
>> class app_deployer2 {
>>
>> define fil($ensure= "present", $path) { file {$name:
>>    content => "this is a test"
>>    }
>>  }

In addition to what Rob mentioned, $name gets translate to the title
of the resource, which is "File1". So if you meant to do support
something similar to puppet resource where you have a namevar and it
defaults to the title, unless you specify namevar (example below is
path) write it this way:

define my_file ($path = $name, $content) {
  file { $name:
    path     => $path,
    content => $content,
  }
}

This is supported starting 2.6.5+ with the fix of #5061.

Thanks,

Nan

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to