You also could do this by having your directory structure on your fileserver, of src/path/my Then file { "/home/jeff/src": mode => 0755, owner => jeff, group => jeff, ensure => directory, recurse => true; }
If that directory structure is to be common across multiple users, it can save you some typing in the long run, if you set up a custom definition so that you can substitute $name everywhere there is a jeff... just a thought... On Oct 8, 1:47 pm, Teyo Tyree <[EMAIL PROTECTED]> wrote: > Hey Jeff, > > Jeff wrote: > > Hi all, > > > I'd like to add a several directories and I can't seem to do it with a > > single "file" directive. > > You can do this with syntax, but puppet will still be explicitly > managing each directory as a separate resource: > > $base = "/home/jeff" > > file {["$basedir", "$basedir/src", "$basedir/src/my", > "$basedir/src/my/dir", "$basedir/src/my/dir/path" ]: #Just pass the > file resource an array of files. > mode => 0755, > owner => jeff, > group => jeff, > ensure => directory, > recurse => true > > } > > Say /home/jeff exists and I want to add /home/jeff/src/my/dir/path > > > I tried: > > > file { "/home/jeff/src/my/dir/path": > > path => "/home/jeff/src/my/dir/path", > > mode => 0755, > > owner => jeff, > > group => jeff, > > ensure => directory, > > recurse => true, > > } > > > But puppet complains the parent directory doesn't exist. How can I do > > the equivalent of > > > mkdir -p /home/jeff/src/my/dir/path > > Puppet will implicitly order the creation of the directories, so it will > behave like mkdir -p. A little more typing, still explicitly managed. > > > TIA, > > Jeff > > -- --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---