You are passing an array (dir_name) into a single resource. Instead you
want to create three separate resources:

  module_name::move { [ dir1, dir2, dir3 ]: ... }


Also, I feel compelled to point out that having verbs or actions as names
of resources is a big red warning flag, that you're doing something outside
the intended design of puppet. e.g. are you aware that your define will try
to move the directories every time you run the agent with this?



Best Regards, David

On Sun, 18 Nov 2012 23:14:29 -0800 (PST), mickael avedissian
<[email protected]> wrote:
> Hi,
> 
> I'm trying to use puppet to move some folders from one directory to
> another 
> in Windows.
> 
> That being said I have a parameterized define which looks like that:
> 
> define module_name::move ($dir_name, $arg2){
> 
> $dir_origin = "c:/${dir_name}"
> $dir_destination = "c:/tmp/${arg2}"
> 
> file { $dir_destination:
>   ensure => 'directory',
>   mode => '755',
> }
> 
> exec { $backup_folder :
>     command => "cmd.exe /c move $dir_origin $dir_destination",
>     path => 'c:\windows\system32;c:\windows',
> }
> }
> 
> 
> and I call the define as follow:
>   module_name::move { 'folder_name': 
>     dir_name => ['dir1','dir2','dir3'],
>     arg2 => blah,
>   }
> 
> 
> when I execute this code, puppet concatenate the value of $dir_name as 
> dir1dir2dir3 instead of running my define 3 separate times.
> 
> I would greatly appreciate getting some help on how I could reach my 
> purpose.
> 
> Thanks,
> Mike

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

Reply via email to