Hi, define sysdir($dirs) {
define subdir($base) { file { "$base/$name": ensure => directory } } file { "/mnt/$name": ensure => directory } suddir { $dirs: base => "/mnt/$name" } } sysdir { $sys_name: dirs => $mounts } Haven't tested it, but something like this should work. Little convoluted, though, but your requirements are not easy to meet. Cheers, Felix On 11/16/2010 06:33 PM, hudsterboy wrote: > I'm trying to create a directory structure from 2 arrays. First array > is the "outter", second is the "inner". For each "outter", I'd like to > loop through each "inner". > > Below is sort of what I'm trying to do. In the real world, the > $sys_name and $mounts vars will be parsed from yaml and will be > dynamic. In the example I've created static arrays for simplicity. > > Please don't critique the code. I know it won't work and is the wrong > way to do it. I just want to give an idea of what I'm trying to do. > > $sys_name = ['sys1', 'sys2', 'sys3', 'sys4'] > $mounts = ['home', 'var', 'usr', 'duck', 'goose'] > > File { owner => 'root', group => 'root', mode => '0755', ensure => > directory } > > define outter () { > file { "/mnt/$sys_name": } > > define inner () { > file {"$mount_base/$mounts":} > } > inner { $mounts } > > } > outter { $sys_name: } > > So basically create directories from a dynamic array inside > directories created from a dynamic array. > Any way to do this in a simple way? > -- 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.