On Fri, Oct 14, 2011 at 5:20 AM, Rob Sweet <
rhs...@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