Skip to content

Conversation

@justinclayton
Copy link

Great module! We needed this property, as we used it in our existing msbuild scripts that ran appcmd.exe, so we added it. Worked like a champ for us.

@simondean
Copy link
Owner

Hi Justin. Thanks for the feedback! There's a quirk with the way appcmd works. In IIS Manager, a site has a physical path and an app pool. In appcmd a site doesn't really have a physical path or an app pool. 

Appcmd let's you set a physical path on a site but it really just lets you do that as a convenience; behind the scenes when you specify a physical path on a site, appcmd is really creating an app and a virtual directory for the root of the site and assigns the physical path to that virtual directory. 

Appcmd (and I guess the internals of IIS itself) treat every site as the combination of a site, app and virtual directory. I could do with adding some documentation around this as it's not too clear from the module. 

So basically this:

  iis_site {'Default Web Site':
    ensure          => present,
    applicationpool => 'DefaultAppPool',
    physicalpath    => 'c:\inetpub\wwwroot'
  }

Is really this:

  iis_site {'Default Web Site':
    ensure          => present,
  }

  iis_app {'Default Web Site/':
    ensure          => present,
    applicationpool => 'DefaultAppPool',
  }

  iis_vdir {'Default Web Site/':
    ensure          => present,
    iis_app         => 'Default Web Site/',
    physicalpath    => 'c:\inetpub\wwwroot'
  }

If you split your iis_site into an iis_site, an iis_app and an iis_vdir as above it should work ok out of the box. Thanks for taking the time to send a pull request. 

Cheers 
Simon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants