you could do something like this:
define loopydir() {
file { "$module::params::base_dir/${name}":
ensure => "directory"
owner => "root",
group => "root",
}
}
include module::params
file { "$module::params::base_dir" :
ensure => "directory"
owner => "root"
group => "root",
}
loopydir{ [1,2,3]: }
On Wed, Apr 25, 2012 at 10:57 AM, Brian Carpio <bcarpio@thetek.net> wrote:
> Is there a way to define a single file resource or even exec resource
> like this:
>
> file { "$module::params::base_dir" :
> ensure => "directory"
> owner => "root"
> group => "root",
> }
>
> file { "$module::params::base_dir/$module::params::name":
> ensure => "directory"
> owner => "root",
> group => "root",
> }
>
> I want to define module::params::name like:
>
> class module::params {
>
> $name = [ dir1, dir2, dir3 ]
>
> }
>
> Something like that so I don''t have to make a full file definition
for
> each directory I want to create. Each directory will reside under the
> $module::params::base which would be like /home/git and each dir1,
> dir2 etc.. would be like /home/git/dir1, /home/git/dir2, /home/git/
> dir3 etc...
>
> --
> 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+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.