Ask Your Question

When trying to apply a file resource in Windows

asked 2015-02-25 05:22:24 -0600

darfaur gravatar image

updated 2015-02-25 11:00:40 -0600

GregLarkin gravatar image

Trying to apply my manifest to a machine and I receive the following error:-

Error: Could not set 'file' on ensure: No such file or directory - C:/inetput/wwwroot/<site>/logout.aspx20150225-8528-15rwbii.locl at 10:/<site>logout.pp

Using an administative command prompt to run the command and all the files etc are available either in their folder or in the root of C

My manifest is below:-

file {"<site>":
  owner => 'Administor',
  group => 'Administors',
  ensure => file,
  path => "C:\\inetpub\\wwwroot\\<site>\\Logout.aspx",
  source => "C:\\Logout<site>.aspx",
  force => 'yes',
  replace => 'yes',
  mode => '0002'
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-02-25 11:35:10 -0600

GregLarkin gravatar image

Does the full path C:\\inetpub\\wwwroot\\<site>\\ already exist, or are you managing it in your Puppet code somewhere?

The Puppet file resource will not automatically create the directory structure for the destination file, so you may need to do that before applying this resource.

edit flag offensive delete link more


Yes all the directories already exist, its part of automating releases for the site so each is already in place.

darfaur gravatar imagedarfaur ( 2015-02-25 13:33:14 -0600 )edit

Can you add the flags "--debug --trace" to your Puppet agent run and post a link to a pastebin of the output? That may shed some additional light on what's going on here.

GregLarkin gravatar imageGregLarkin ( 2015-02-25 16:51:41 -0600 )edit

darfaur gravatar imagedarfaur ( 2015-02-26 04:05:06 -0600 )edit

Can you remove the source, force, replace and mode attributes and re-apply the resource to your system? Make sure that the target file doesn't already exist, too. I want to strip this problem down to the simplest reproducible test case, in case that helps lead to a solution.

GregLarkin gravatar imageGregLarkin ( 2015-02-26 15:11:28 -0600 )edit Sorry for the delay and thanks again for all the help.

darfaur gravatar imagedarfaur ( 2015-02-27 03:10:45 -0600 )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: 2015-02-25 05:22:24 -0600

Seen: 218 times

Last updated: Feb 25 '15