Ask Your Question

How to create directory / folders in windows using manifests

asked 2014-11-17 15:15:56 -0500

Renuka gravatar image

I was trying to create folder and file using manifests ,I could create file if the folder structure exists.If folder/directory is not exists ..the script is failing.

file { 'C:\Users\ABC\a\HelloWorld.txt': ensure => file, mode =>'0644', content => "Hello World", }

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-11-17 16:18:34 -0500

updated 2014-11-17 16:18:44 -0500

You need to ensure directories as well. Puppet is not going to automagically create the folders for a file. And a best practice is to use forward slashes instead of back slashes.

file { ['c:/users', 'c:/users/ABC', 'c:/users/ABC/a']: ensure => directory,}
edit flag offensive delete link more


Thanks.., for the response.

Renuka gravatar imageRenuka ( 2014-11-18 12:35:05 -0500 )edit

If this answers your question, please mark it as the answer. Thanks!

rob gravatar imagerob ( 2014-11-24 15:23:21 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-11-17 15:15:56 -0500

Seen: 2,026 times

Last updated: Nov 17 '14