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 #10340

file resource type should support creating parent tree

Added by Steve Shipway over 4 years ago. Updated over 4 years ago.

Status:DuplicateStart date:10/27/2011
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Affected Puppet version: Branch:

We've Moved!

Ticket tracking is now hosted in JIRA:


if you have this resource:

file { ‘/usr/local/foo/bar’: content=>‘xxx’, ensure=>present; }

but the directory /usr/local/foo does not exist, then you get an error. I would prefer that there be a flag for ‘create path if required’ — IE, run a ‘mkdir -p /usr/local/foo’ — so that the resource can succeed. It would be good if the flag were enabled by default, though we can always set our own defaults of course.

Related issues

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


#1 Updated by James Turnbull over 4 years ago

  • Category set to file
  • Status changed from Unreviewed to Duplicate

Steve – this is a duplicate of an earlier bug #86 – it’s worth reading the very long thread in there to see why we don’t do this and see some suggested workarounds.

Also available in: Atom PDF