The Puppet Labs Issue Tracker has Moved:

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using See the following page for information on filing tickets with JIRA:

Feature #3522

a "mkdir -p" option for the file type

Added by Roy Nielsen about 6 years ago. Updated about 6 years ago.

Status:DuplicateStart date:04/08/2010
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Affected Puppet version:0.25.4 Branch:

We've Moved!

Ticket tracking is now hosted in JIRA:


There should be an option that will create a nested directory tree, like the “-p” flag for mkdir.

I should be able to create:

/my/special/tree/structure with one file resource, instead of four – I should be able to:

file { “mytree” : path => “/my/special/tree/structure”, ensure => directory, create => true, }

instead of:

file { “my” : path => “/my”, ensure => directory, before => File[“special”], } file { “special” : path => “/my/special”, ensure => directory, before => File[“tree”], } file { “tree” : path => “/my/special/tree”, ensure => directory, before => File[“structure”], } file { “structure” : path => “/my/special/tree/structure”, ensure => directory, }

Another idea, rather than creating a new “create” parameter would be to overload the recurse parameter.

Regards, -Roy

Related issues

Related to Puppet - Feature #86: Directory creation fails if parent directory does not exist Rejected


#1 Updated by Paul Lathrop about 6 years ago

  • Status changed from Unreviewed to Duplicate

Dupe of #86

Also available in: Atom PDF