Giter VIP home page Giter VIP logo

iis's Introduction

iis Cookbook

Cookbook Version CI State OpenCollective OpenCollective License

Description

Installs and configures Microsoft Internet Information Services (IIS) 7.0 and later

Maintainers

This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.

Requirements

Platforms

  • Windows Server 2016
  • Windows Server 2019

Chef

  • Chef 12.14+

Cookbooks

  • windows if running on chef < 16

Attributes

  • node['iis']['home'] - IIS main home directory. default is %WINDIR%\System32\inetsrv
  • node['iis']['conf_dir'] - location where main IIS configs lives. default is %WINDIR%\System32\inetsrv\config
  • node['iis']['pubroot'] - . default is %SYSTEMDRIVE%\inetpub
  • node['iis']['docroot'] - IIS web site home directory. default is %SYSTEMDRIVE%\inetpub\wwwroot
  • node['iis']['cache_dir'] - location of cached data. default is %SYSTEMDRIVE%\inetpub\temp
  • node['iis']['windows_feature_install_method'] - specify the install method that will be used by any windows_feature resources. If ommitted it will not be specified and will use windows_feature_dism by default. Valid options are :windows_feature_dism, :windows_feature_powershell, :windows_feature_servermanagercmd. Default is :windows_feature_dism

Resources

Recipies

These recipies still exist but are highly likely to be removed in future major releases of this cookbook.

default recipe

Installs and configures IIS 7.0/7.5/8.0 using the default configuration.

mod_* recipes

This cookbook also contains recipes for installing individual IIS modules (extensions). These recipes can be included in a node's run_list to build the minimal desired custom IIS installation.

  • mod_aspnet - installs ASP.NET runtime components
  • mod_aspnet45 - installs ASP.NET 4.5 runtime components
  • mod_auth_basic - installs Basic Authentication support
  • mod_auth_windows - installs Windows Authentication (authenticate clients by using NTLM or Kerberos) support
  • mod_compress_dynamic - installs dynamic content compression support. PLEASE NOTE - enabling dynamic compression always gives you more efficient use of bandwidth, but if your server's processor utilization is already very high, the CPU load imposed by dynamic compression might make your site perform more slowly.
  • mod_compress_static - installs static content compression support
  • mod_ftp - installs FTP service
  • mod_iis6_metabase_compat - installs IIS 6 Metabase Compatibility component.
  • mod_isapi - installs ISAPI (Internet Server Application Programming Interface) extension and filter support.
  • mod_logging - installs and enables HTTP Logging (logging of Web site activity), Logging Tools (logging tools and scripts) and Custom Logging (log any of the HTTP request/response headers, IIS server variables, and client-side fields with simple configuration) support
  • mod_management - installs Web server Management Console which supports management of local and remote Web servers
  • mod_security - installs URL Authorization (Authorizes client access to the URLs that comprise a Web application), Request Filtering (configures rules to block selected client requests) and IP Security (allows or denies content access based on IP address or domain name) support.
  • mod_tracing - installs support for tracing ASP.NET applications and failed requests.

Note: Not every possible IIS module has a corresponding recipe. The foregoing recipes are included for convenience, but users may also place additional IIS modules that are installable as Windows features into the node['iis']['components'] array.

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website https://opencollective.com/sous-chefs/sponsor/8/website https://opencollective.com/sous-chefs/sponsor/9/website

iis's People

Contributors

awayne avatar btm avatar cwebberops avatar damacus avatar dave-q avatar easyasabc123 avatar epardee avatar guilhem avatar hh avatar iennae avatar jakauppila avatar jeremymv2 avatar jonathanmorley avatar kitchen-porter avatar kkennedy1 avatar mattstratton avatar olivierlemasle avatar ramereth avatar renovate[bot] avatar rlaveycal avatar roberto-mardeni avatar ruchigoyal2005 avatar schisamo avatar sethvargo avatar smurawski avatar sneal avatar spuder avatar tas50 avatar xorima avatar xorimabot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

iis's Issues

iis_app isn't idempotent

I want to change the IIS Application Pool that an Application uses. I changed the application_pool attribute of my iis_app resource but when I run the recipe a FATAL error occurs:

FATAL: Mixlib::ShellOut::ShellCommandFailed
: iis_app[Default Web Site] (recp-db-necromancer::default line 30) had an error:
 Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but re
ceived '183'
snydevel ---- Begin output of C:\Windows\System32\inetsrv\appcmd.exe add app /si
te.name:"Default Web Site" /path:"/db-necromancer" /applicationPool:"DB Necroman
cer" /physicalPath:"C:\inetpub\wwwroot\db-necromancer" /enabledProtocols:"http"
----
snydevel STDOUT: ERROR ( message:Failed to add duplicate collection element "/db
-necromancer". )
snydevel STDERR:
snydevel ---- End output of C:\Windows\System32\inetsrv\appcmd.exe add app /site
.name:"Default Web Site" /path:"/db-necromancer" /applicationPool:"DB Necromance
r" /physicalPath:"C:\inetpub\wwwroot\db-necromancer" /enabledProtocols:"http" --
--
snydevel Ran C:\Windows\System32\inetsrv\appcmd.exe add app /site.name:"Default
Web Site" /path:"/db-necromancer" /applicationPool:"DB Necromancer" /physicalPat
h:"C:\inetpub\wwwroot\db-necromancer" /enabledProtocols:"
snydevel http" returned 183

Here's the same output as above but without the 'column breaks' (for easier searching):

snydevel [2015-01-23T10:40:22-05:00] FATAL: Mixlib::ShellOut::ShellCommandFailed
: iis_app[Default Web Site] (recp-db-necromancer::default line 30) had an error:
 Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '183'
snydevel ---- Begin output of C:\Windows\System32\inetsrv\appcmd.exe add app /site.name:"Default Web Site" /path:"/db-necromancer" /applicationPool:"DB Necromancer" /physicalPath:"C:\inetpub\wwwroot\db-necromancer" /enabledProtocols:"http"
----
snydevel STDOUT: ERROR ( message:Failed to add duplicate collection element "/db-necromancer". )
snydevel STDERR:
snydevel ---- End output of C:\Windows\System32\inetsrv\appcmd.exe add app /site.name:"Default Web Site" /path:"/db-necromancer" /applicationPool:"DB Necromancer" /physicalPath:"C:\inetpub\wwwroot\db-necromancer" /enabledProtocols:"http" --
--
snydevel Ran C:\Windows\System32\inetsrv\appcmd.exe add app /site.name:"Default Web Site" /path:"/db-necromancer" /applicationPool:"DB Necromancer" /physicalPath:"C:\inetpub\wwwroot\db-necromancer" /enabledProtocols:"
snydevel http" returned 183

iis_pool issue when setting a gMSA identity

I can no longer set gMSA accounts using iis_pool resource. These accounts do not have passwords, and it seems the pool provider is checking to ensure the pool_password is not an empty string. Setting pool_password to nil also does not work.

Derived Attributes Non-Functional in Chef 12+

Validated that the 11.x Chef clients work fine, and the issue is present only in 12+ environments.

Within the cookbook attribute file: iis/attributes/default.rb

This is currently defined:
default['iis']['home'] = "#{ENV['WINDIR']}\\System32\\inetsrv"
default['iis']['conf_dir'] = "#{iis['home']}\\config"
default['iis']['pubroot'] = "#{ENV['SYSTEMDRIVE']}\\inetpub"
default['iis']['docroot'] = "#{iis['pubroot']}\\wwwroot"
default['iis']['log_dir'] = "#{iis['pubroot']}\\logs\\LogFiles"
default['iis']['cache_dir'] = "#{iis['pubroot']}\\temp"

As of chef 12 only the first derived attribute is properly calculated. Printing out the values within a run is enough to see the issue:
DEBUG: default['iis']['home'] = C:\Windows\System32\inetsrv
DEBUG: default['iis']['conf_dir'] = C:\Windows\System32\inetsrv\config
DEBUG: default['iis']['pubroot'] = C:\inetpub
DEBUG: default['iis']['docroot'] = \wwwroot
DEBUG: default['iis']['log_dir'] = \logs\LogFiles
DEBUG: default['iis']['cache_dir'] = \temp

You can see that only the first attribute is properly calculated be reversing the order of declaration and running again:
default['iis']['pubroot'] = "#{ENV['SYSTEMDRIVE']}\\inetpub"
default['iis']['docroot'] = "#{iis['pubroot']}\\wwwroot"
default['iis']['log_dir'] = "#{iis['pubroot']}\\logs\\LogFiles"
default['iis']['cache_dir'] = "#{iis['pubroot']}\\temp"
default['iis']['home'] = "#{ENV['WINDIR']}\\System32\\inetsrv"
default['iis']['conf_dir'] = "#{iis['home']}\\config"

In this scenario only iis[home] will be empty.

If you fully declare the attributes as below it works in other recipes:
default['iis']['home'] = "#{ENV['WINDIR']}\\System32\\inetsrv"
default['iis']['conf_dir'] = "#{ENV['WINDIR']}\\System32\\inetsrv\\config"
default['iis']['pubroot'] = "#{ENV['SYSTEMDRIVE']}\\inetpub"
default['iis']['docroot'] = "#{ENV['SYSTEMDRIVE']}\\inetpub\\wwwroot"
default['iis']['log_dir'] = "#{ENV['SYSTEMDRIVE']}\\inetpub\\logs\\LogFiles"
default['iis']['cache_dir'] = "#{ENV['SYSTEMDRIVE']}\\inetpub\\temp

EDIT:
I've also submitted: chef-boneyard/chef-client#258

iis_pool resource fails on coverge due to appcmd time attribute not of the correct format.

Current master branch has a fault where the configuration of an app pool fails due to the appcmd call passing a time attribute with a blank string which fails the appcmd with error code 13.

Backtrace:

Resource Declaration:

In C:/chef/cache/cookbooks/poal_Testwebsite/recipes/default.rb

12: iis_pool "#{node['poal_Testwebsite']['app_pool']}" do
13: action [:add,:config]
14: pipeline_mode node['poal_Testwebsite']['pipelinemode']
15: thirty_two_bit node['poal_Testwebsite']['thirty_two_bit']
16: runtime_version node['poal_Testwebsite']['app_pool_dotnetversion']
17: end
18:

Compiled Resource:

Declared in C:/chef/cache/cookbooks/poal_Testwebsite/recipes/default.rb:12:in `from_file'

iis_pool("TestAppPool") do
action [:add, :config]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :iis_pool
cookbook_name "poal_Testwebsite"
recipe_name "default"
pipeline_mode :Classic
thirty_two_bit true
runtime_version "2.0"
pool_name "TestAppPool"
start_mode :OnDemand
auto_start true
queue_length 1000
pool_identity :ApplicationPoolIdentity
logon_type :LogonBatch
idle_timeout "00:20:00"
shutdown_time_limit "00:01:30"
startup_time_limit "00:01:30"
pinging_enabled true
ping_interval "00:00:30"
ping_response_time "00:01:30"
load_balancer_capabilities :HttpLevel
rapid_fail_protection true
rapid_fail_protection_interval "00:05:00"
rapid_fail_protection_max_crashes 5
cpu_action :NoAction
cpu_limit 0
cpu_reset_interval "00:05:00"
smp_processor_affinity_mask 4294967295
smp_processor_affinity_mask_2 4294967295
end

[2015-04-29T09:10:26+12:00] INFO: Running queued delayed notifications before re-raising exception
[2015-04-29T09:10:26+12:00] ERROR: Converge failed with error message iis_pool[TestAppPool](poal_Testwebsite::default line 12) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '13'
---- Begin output of C:\Windows\System32\inetsrv\appcmd.exe set config /section:applicationPools "/[name='TestAppPool'].autoStart:true" "/[name='TestAppPool'].startMode:OnDemand" "/[name='TestAppPool'].managedRuntimeVersion:v2.0" "/[name='TestAppPool'].managedPipelineMode:Classic" "/[name='TestAppPool'].enable32BitAppOnWin64:true" "/[name='TestAppPool'].queueLength:1000" "/[name='TestAppPool'].processModel.maxProcesses:" "/[name='TestAppPool'].processModel.loadUserProfile:false" "/[name='TestAppPool'].processModel.logonType:LogonBatch" "/[name='TestAppPool'].processModel.manualGroupMembership:false" "/[name='TestAppPool'].processModel.idleTimeout:00:20:00" "/[name='TestAppPool'].processModel.shutdownTimeLimit:00:01:30" "/[name='TestAppPool'].processModel.startupTimeLimit:00:01:30" "/[name='TestAppPool'].processModel.pingingEnabled:true" "/[name='TestAppPool'].processModel.pingInterval:00:00:30" "/[name='TestAppPool'].processModel.pingResponseTime:00:01:30" "/[name='TestAppPool'].recycling.periodicRestart.time:" "/+[name='TestAppPool'].recycling.periodicRestart.schedule.[value='']" "/[name='TestAppPool'].recycling.logEventOnRecycle:PrivateMemory,Memory,Schedule,Requests,Time,ConfigChange,OnDemand,IsapiUnhealthy" "/[name='TestAppPool'].recycling.periodicRestart.privateMemory:" "/[name='TestAppPool'].recycling.disallowRotationOnConfigChange:false" "/[name='TestAppPool'].recycling.disallowOverlappingRotation:false" "/[name='TestAppPool'].failure.loadBalancerCapabilities:HttpLevel" "/[name='TestAppPool'].failure.orphanWorkerProcess:false" "/[name='TestAppPool'].failure.orphanActionExe:" "/[name='TestAppPool'].failure.orphanActionParams:" "/[name='TestAppPool'].failure.rapidFailProtection:true" "/[name='TestAppPool'].failure.rapidFailProtectionInterval:00:05:00" "/[name='TestAppPool'].failure.rapidFailProtectionMaxCrashes:5" "/[name='TestAppPool'].failure.autoShutdownExe:" "/[name='TestAppPool'].failure.autoShutdownParams:" "/[name='TestAppPool'].cpu.action:NoAction" "/[name='TestAppPool'].cpu.limit:0" "/[name='TestAppPool'].cpu.resetInterval:00:05:00" "/[name='TestAppPool'].cpu.smpAffinitized:false" "/[name='TestAppPool'].cpu.smpProcessorAffinityMask:4294967295" "/[name='TestAppPool'].cpu.smpProcessorAffinityMask2:4294967295" ----
STDOUT: ERROR ( message:Can not set attribute "time" to value "".. Reason: Timespan must be of form [-][d.]hh:mm:ss[.ff]

Manage MIME Types

Feature Request: Add the ability to manage MIME Types.

An example of how to do this though powershell.

$env:windir\system32\inetsrv\appcmd set config /section:staticContent /+"[fileExtension=' .dmg ',mimeType=' application/octet-stream ']"

screenshot 2015-03-02 13 52 16

iis_site resource does not detect that the application_pool attribute needs to be changed

IIS 4.1 cookbook does not detect that the application pool needs to be changed when the resource is set to :config.

  • IIS 8.5
  • Chef Client 12.0.1
  • Attributes
default['test_iis']['app_pool'] = 'TestAppPool'
default['poal_venuswebsite']['website'] = 'Test'
  • Recipe
iis_site "#{node['test_iis']['website']}" do
  protocol  :http
  port 80
  path "#{node['iis']['docroot']}\\#{node['test_iis']['phypath']}\\test_iis"
  host_header ""
  application_pool "#{node['test_iis']['app_pool']}"
  action  [:add,:config]
end

Deprecated RSpec message still showing

Due to dependencies, five deprecated messages appear every time rspec is run:

[DEPRECATION] `ChefSpec::Runner.define_runner_method' is deprecated. It is being used in the iis_app resource matcher. Please use `ChefSpec.define_matcher' instead.
[DEPRECATION] `ChefSpec::Runner.define_runner_method' is deprecated. It is being used in the iis_config resource matcher. Please use `ChefSpec.define_matcher' instead.
[DEPRECATION] `ChefSpec::Runner.define_runner_method' is deprecated. It is being used in the iis_module resource matcher. Please use `ChefSpec.define_matcher' instead.
[DEPRECATION] `ChefSpec::Runner.define_runner_method' is deprecated. It is being used in the iis_pool resource matcher. Please use `ChefSpec.define_matcher' instead.
[DEPRECATION] `ChefSpec::Runner.define_runner_method' is deprecated. It is being used in the iis_site resource matcher. Please use `ChefSpec.define_matcher' instead.

I believe this issue has been resolved in the master version of this cookbook, but supermarket is still locked to version 2.1.6.

I guess this not so much an issue but more a question of when you will release version 3.0.x of this cookbook to supermarket so that these messages will stop appearing.
Bear in mind anyone using the php cookbook will see these messages due to a dependency back to this cookbook.

Compile error loading Opscode::IIS::Helper::Windows

There is an error with this cookbook on Linux (tested on Amazon Linux 2014.9 and CentOS 7.0) when running under Chef client 12.1+. Attempting to converge with a run list of "recipe[chef-client]" (which transitively depends on "iis") fails with the following error. This error does not occur when using the latest Chef 11 client to converge. Hiding the include Windows::Helper statement under an if RUBY_PLATFORM resolves the error. I wonder if there is some new behavior in Chef 12 that prevents a Windows library from loading on Linux?

================================================================================
Recipe Compile Error in /root/.chef/local-mode-cache/cache/cookbooks/iis/libraries/helper.rb
================================================================================

NameError
---------
uninitialized constant Opscode::IIS::Helper::Windows

Cookbook Trace:
---------------
  /root/.chef/local-mode-cache/cache/cookbooks/iis/libraries/helper.rb:31:in `<module:Helper>'
  /root/.chef/local-mode-cache/cache/cookbooks/iis/libraries/helper.rb:24:in `<module:IIS>'
  /root/.chef/local-mode-cache/cache/cookbooks/iis/libraries/helper.rb:23:in `<module:Opscode>'
  /root/.chef/local-mode-cache/cache/cookbooks/iis/libraries/helper.rb:22:in `<top (required)>'

Relevant File Content:
----------------------
/root/.chef/local-mode-cache/cache/cookbooks/iis/libraries/helper.rb:

 29:        require 'rexml/document'
 30:        include REXML
 31>>       include Windows::Helper
 32:
 33:        def self.older_than_windows2008r2?

Provider pool.rb sytax error in line 280

Syntax error in the provider file pool.rb on line 280 within current master branch. Chef run crashes. Suspect "returns" should be ":returns"

[2015-04-29T07:50:37+12:00] ERROR: Converge failed with error message iis_pool[
VenusAppPool](poal_venuswebsite::default line 12) had an error: NameError: No
resource, method, or local variable named returns' forChef::Provider::IisPoo
l ""'
[2015-04-29T07:50:37+12:00] DEBUG: Re-raising exception: Chef::Exceptions::RunF
ailedWrappingError - Found 1 errors, they are stored in the backtrace

  1. NameError - iis_pool[VenusAppPool](poal_venuswebsite::default line 12) had
    an error: NameError: No resource, method, or local variable named returns' fo rChef::Provider::IisPool ""'
    C:/opscode/chef/embedded/apps/chef/lib/chef/dsl/recipe.rb:51:in rescue in me thod_missing' C:/opscode/chef/embedded/apps/chef/lib/chef/dsl/recipe.rb:46:inmethod_missi
    ng'
    C:/chef/cache/cookbooks/iis/providers/pool.rb:280:in configure_application_p ool' C:/chef/cache/cookbooks/iis/providers/pool.rb:187:inconfigure'
    C:/chef/cache/cookbooks/iis/providers/pool.rb:46:in block in class_from_file ' C:/opscode/chef/embedded/apps/chef/lib/chef/provider/lwrp_base.rb:138:inins
    tance_eval'
    C:/opscode/chef/embedded/apps/chef/lib/chef/provider/lwrp_base.rb:138:in blo ck in action' C:/opscode/chef/embedded/apps/chef/lib/chef/provider.rb:149:inrun_action'
    C:/opscode/chef/embedded/apps/chef/lib/chef/resource.rb:561:in run_action' C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:49:inrun_action'
    C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:81:in block (2 levels) in converge' C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:81:ineach'
    C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:81:in block in converg e' C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list .rb:83:inblock in execute_each_resource'
    C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iter
    ator.rb:116:in call' C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iter ator.rb:116:incall_iterator_block'
    C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iter
    ator.rb:85:in step' C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iter ator.rb:104:initerate'
    C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iter
    ator.rb:55:in each_with_index' C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list .rb:81:inexecute_each_resource'
    C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:80:in converge' C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:331:inblock in conver
    ge'
    C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:326:in catch' C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:326:inconverge'
    C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:345:in converge_and_sa ve' C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:448:inrun'
    C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:253:in run_with_g raceful_exit_option' C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:230:inblock in r
    un_chef_client'
    C:/opscode/chef/embedded/apps/chef/lib/chef/local_mode.rb:38:in with_server_ connectivity' C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:213:inrun_chef_c
    lient'
    C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:392:in blo ck in interval_run_chef_client' C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:382:inloo
    p'
    C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:382:in int erval_run_chef_client' C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:372:inrun
    _application'
    C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:60:in run' C:/opscode/chef/embedded/apps/chef/bin/chef-client:26:in<top (required)>'
    C:/opscode/chef/bin/chef-client:64:in load' C:/opscode/chef/bin/chef-client:64:in'

host_header changes not applying on config

Oops sorry, I did this backwards because admittedly I didn't read the contribution guidelines until after creating the pull request.

I noticed host_header changes would only take effect on add, not on config.

This seems to be because is_new_port_host_provided is checking to see if the binding combo is already included, which it never will be. This prevents the binding being added on line 79. This commit just flips the logic.

It also fixes an edge-case where a config change with a host-header of localhost-foo -> localhost wouldn't get applied (since technically http/*:80:localhost is included in http/*:80:localhost-foo).

iis_app :config bug

when running iis_app action :config and there isn't anything to happen it throws the following exception:

================================================================================
Error executing action `config` on resource 'iis_app[Testfu Site]'
================================================================================


TypeError
---------
can't dup NilClass

Site.rb provider action [:add] doesn't set a specified custom log_directory attribute.

Specifying a log_directory attribute is ignored when adding a new site using the [:add, :start] options for the iis_site provider.
The same attribute gets set when using the [:config] action for the iis_site provider.

As a workaround I have created the site and ran a [:config] right after that, just setting the custom log_directory.

Can this be fixed in the add part of the iis_site provider please?

Typo in readme

The readme has the following sentence which appears to be incomplete.

that the application pool should be automatically started when it is created or when IIS

When IIS does what?

processModel.setProfileEnvironment is not an available setting for application pool

I was having an issue using the pool provider to create an application pool on Windows 2008 R2.

I tracked it down to this line:

configure_application_pool(is_new_set_profile_environment, "processModel.setProfileEnvironment:#{@new_resource.set_profile_environment}")

It turns out that processModel.setProfileEnvironment is not an available setting for my version of Windows/IIS.

Commenting out this line fixed my problems. If its helpful, here are the available settings as reported by appcmd.exe:

C:\Users\vagrant>c:\Windows\system32\inetsrv\appcmd.exe set config /section:applicationPools /?
ERROR ( message:-applicationPoolDefaults.name
-applicationPoolDefaults.queueLength
-applicationPoolDefaults.autoStart
-applicationPoolDefaults.enable32BitAppOnWin64
-applicationPoolDefaults.managedRuntimeVersion
-applicationPoolDefaults.managedRuntimeLoader
-applicationPoolDefaults.enableConfigurationOverride
-applicationPoolDefaults.managedPipelineMode
-applicationPoolDefaults.CLRConfigFile
-applicationPoolDefaults.passAnonymousToken
-applicationPoolDefaults.startMode
-applicationPoolDefaults.processModel.identityType
-applicationPoolDefaults.processModel.userName
-applicationPoolDefaults.processModel.password
-applicationPoolDefaults.processModel.loadUserProfile
-applicationPoolDefaults.processModel.logonType
-applicationPoolDefaults.processModel.manualGroupMembership
-applicationPoolDefaults.processModel.idleTimeout
-applicationPoolDefaults.processModel.maxProcesses
-applicationPoolDefaults.processModel.shutdownTimeLimit
-applicationPoolDefaults.processModel.startupTimeLimit
-applicationPoolDefaults.processModel.pingingEnabled
-applicationPoolDefaults.processModel.pingInterval
-applicationPoolDefaults.processModel.pingResponseTime
-applicationPoolDefaults.recycling.disallowOverlappingRotation
-applicationPoolDefaults.recycling.disallowRotationOnConfigChange
-applicationPoolDefaults.recycling.logEventOnRecycle
-applicationPoolDefaults.recycling.periodicRestart.memory
-applicationPoolDefaults.recycling.periodicRestart.privateMemory
-applicationPoolDefaults.recycling.periodicRestart.requests
-applicationPoolDefaults.recycling.periodicRestart.time
-applicationPoolDefaults.recycling.periodicRestart.schedule.[value='timespan'].v
alue
-applicationPoolDefaults.failure.loadBalancerCapabilities
-applicationPoolDefaults.failure.orphanWorkerProcess
-applicationPoolDefaults.failure.orphanActionExe
-applicationPoolDefaults.failure.orphanActionParams
-applicationPoolDefaults.failure.rapidFailProtection
-applicationPoolDefaults.failure.rapidFailProtectionInterval
-applicationPoolDefaults.failure.rapidFailProtectionMaxCrashes
-applicationPoolDefaults.failure.autoShutdownExe
-applicationPoolDefaults.failure.autoShutdownParams
-applicationPoolDefaults.cpu.limit
-applicationPoolDefaults.cpu.action
-applicationPoolDefaults.cpu.resetInterval
-applicationPoolDefaults.cpu.smpAffinitized
-applicationPoolDefaults.cpu.smpProcessorAffinityMask
-[name='string'].name
-[name='string'].queueLength
-[name='string'].autoStart
-[name='string'].enable32BitAppOnWin64
-[name='string'].managedRuntimeVersion
-[name='string'].managedRuntimeLoader
-[name='string'].enableConfigurationOverride
-[name='string'].managedPipelineMode
-[name='string'].CLRConfigFile
-[name='string'].passAnonymousToken
-[name='string'].startMode
-[name='string'].processModel.identityType
-[name='string'].processModel.userName
-[name='string'].processModel.password
-[name='string'].processModel.loadUserProfile
-[name='string'].processModel.logonType
-[name='string'].processModel.manualGroupMembership
-[name='string'].processModel.idleTimeout
-[name='string'].processModel.maxProcesses
-[name='string'].processModel.shutdownTimeLimit
-[name='string'].processModel.startupTimeLimit
-[name='string'].processModel.pingingEnabled
-[name='string'].processModel.pingInterval
-[name='string'].processModel.pingResponseTime
-[name='string'].recycling.disallowOverlappingRotation
-[name='string'].recycling.disallowRotationOnConfigChange
-[name='string'].recycling.logEventOnRecycle
-[name='string'].recycling.periodicRestart.memory
-[name='string'].recycling.periodicRestart.privateMemory
-[name='string'].recycling.periodicRestart.requests
-[name='string'].recycling.periodicRestart.time
-[name='string'].recycling.periodicRestart.schedule.[value='timespan'].value
-[name='string'].failure.loadBalancerCapabilities
-[name='string'].failure.orphanWorkerProcess
-[name='string'].failure.orphanActionExe
-[name='string'].failure.orphanActionParams
-[name='string'].failure.rapidFailProtection
-[name='string'].failure.rapidFailProtectionInterval
-[name='string'].failure.rapidFailProtectionMaxCrashes
-[name='string'].failure.autoShutdownExe
-[name='string'].failure.autoShutdownParams
-[name='string'].cpu.limit
-[name='string'].cpu.action
-[name='string'].cpu.resetInterval
-[name='string'].cpu.smpAffinitized
-[name='string'].cpu.smpProcessorAffinityMask
-[name='string'].cpu.smpProcessorAffinityMask2
 )

Let me know if there is anything else that might be helpful to know.

Many of the Attributes won't be applied when adding a new app pool.

See https://github.com/opscode-cookbooks/iis/blob/master/providers/pool.rb#L42

The Attributes in this section of the iis_pool resource are not applied when adding a new app pool, unless you also specify the :config action. I'd expect those attributed to be applied without having to specify the config option.

The following gist illustrates the issue with an example: https://gist.github.com/mdw233/b38016059753dae54941

Is this intended, or an oversight? If it's intended - I can add a PR to make it more clear in the docs.

iis_app config action - xpath incorrect

The xpath queries used to determine the current values do NOT work against the output from appcmd.exe.

For example; xpath = 'APP/application/virtualDirectory/@physicalPath'
But the output from appcmd.exe is wrapped in a root tag of

The xpath query never finds a match and assumes the resource is configured as expected.

Prefixing the xpath with '//' should fix the problem. But shouldn't it also throw if it cannot find the resource we are trying to apply the config to?

Specifying multiple bindings on the same port and ip

I'm trying to setup a site that has 2 80 and 443 bindings, for a total of 4.

.beta.a.com
www.beta.a.com

This way we can have it load balanced and singularly accessed.
I keep getting syntax errors in the iis_site resource doing this. Either I'm missing something or it would be nice to have an iis_binding resource. I've created one but wonder if this is just me brute forcing it to work, while not understanding how to do multiple bindings in the site properly.

Anyone want this?

Compile error in app.rb when creating single app pool and website

Hi Folks

My cookbook only contains a single recipe with the following content and a single change to the metadata.rb file to depend on the iis cookbook 3.0.0

iis_pool "Atlas" do
    pool_name "Atlas"
    runtime_version '4.0'
    pipeline_mode :Integrated
    thirty_two_bit :false
    private_mem 2097152
    worker_idle_timeout '00:00:00'
    recycle_after_time '00:00:00'
    recycle_at_time '00:00:00'
    action [:add, :config, :start]
    retries 3
end

iis_site info[:website_name] do
    protocol :http
    port 80
    path website_dir
    application_pool "Atlas"
    host_header "atlassbx.hps.com"
    action [:add, :start]
    retries 3
end

I'm using Chef 11.16.4 - its a hosted chef instance.

Here were the cookbooks used

[2014-12-22T10:41:29+00:00] INFO: Loading cookbooks [[email protected], [email protected], [email protected], [email protected]]
Synchronizing Cookbooks:

Here was the compile exception:

[2014-12-22T10:41:49+00:00] INFO: Storing updated cookbooks/chef_handler/README.md in the cache.

chef_handler Compiling Cookbooks...
Recipe Compile Error in C:/Users/kennye/.chef/local-mode-cache/cache/cookbooks/iis/providers/app.rb

TypeError

wrong argument type Class (expected Module)

Cookbook Trace:

C:/Users/kennye/.chef/local-mode-cache/cache/cookbooks/iis/providers/app.rb:26:in include' C:/Users/kennye/.chef/local-mode-cache/cache/cookbooks/iis/providers/app.rb:26:inclass_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/mixin/from_file.rb:42:in class_eval' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/mixin/from_file.rb:42:inclass_from_file'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/provider/lwrp_base.rb:94:in build_from_file' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:211:inload_lwrp_provider'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:202:in block in load_lwrps_from_cookbook ' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:201:ineach'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:201:in load_lwrps_from_cookbook' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:121:inblock in compile_lwrps'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:120:in each' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:120:incompile_lwrps'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:73:in compile' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/run_context.rb:88:inload'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/policy_builder/expand_node_object.rb:73:in setup_run_context' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/client.rb:265:insetup_run_context'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/client.rb:429:in do_run' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/client.rb:227:inrun'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/application.rb:217:in run_chef_client' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/application/client.rb:328:inblock in run_application'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/application/client.rb:317:in loop' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/application/client.rb:317:inrun_application'
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/lib/chef/application.rb:67:in run' C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.12.4-x86-mingw32/bin/chef-client:26:in'
C:/opscode/chef/bin/chef-client:23:in load' C:/opscode/chef/bin/chef-client:23:in'

Relevant File Content:

C:/Users/kennye/.chef/local-mode-cache/cache/cookbooks/iis/providers/app.rb:

19: # limitations under the License.
20: #
21:
22: require 'chef/mixin/shell_out'
23: require 'rexml/document'
24:
25: include Chef::Mixin::ShellOut
26>> include Opscode::IIS::Helper
27: include Windows::Helper
28: include REXML
29:
30: action :add do
31: unless @current_resource.exists
32: cmd = "#{appcmd} add app /site.name:\"#{@new_resource.app_name}\""
33: cmd << " /path:\"#{@new_resource.path}\""
34: cmd << " /applicationPool:\"#{@new_resource.application_pool}\"" if @new_resource.application_pool
35: cmd << " /physicalPath:\"#{win_friendly_path(@new_resource.physical_path)}\"" if @new_resource.physical_path

Promote current master branch to version 4.1.1

Hi,

I don't know what the full process is but the fixes in the master build are important enough that I'd be keen to see the cookbook version bumped to 4.1.1 and shipped to the supermarket. Since it fixes at least one bug that will get hit by users pretty regularly it would be good to stop others pulling 4.1 down.

:config on most providers causes an app_pool recycle every 30 minutes

Example:

iis_pool "hello_world" do
    pool_name "hello_world"
    runtime_version runtime_version
    pipeline_mode pipeline_mode
    thirty_two_bit thirty_two_bit_mode
    private_mem private_memory
    worker_idle_timeout '00:00:00'
    recycle_after_time '00:00:00'
    recycle_at_time '00:00:00'
    action [:add, :config, :start]
    retries 3
end

because :config calls functions every single time without validating change we end up recycling the app_pool everytime this runs (30 minutes with chef-client).

I have fixed this on my fork https://github.com/EasyAsABC123/iis using:

cmd_current_values = "#{appcmd} list apppool "#{@new_resource.pool_name}" /config:* /xml"

I'll put in a pull request once my vdir changes are accepted.

iis_pool crashes chef run when setting pipelinemode in current master branch

appcmd option for managepiplineMode is being passed incorrect variable (/[name='TestAppPool'].managedPipelineMode:Classic.capitalize")

Backtrace:
iis_pool("TestAppPool") do
action [:add, :config]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :iis_pool
cookbook_name "poal_Testwebsite"
recipe_name "default"
pipeline_mode :Classic
thirty_two_bit true
runtime_version "2.0"
pool_name "TestAppPool"
start_mode :OnDemand
auto_start true
queue_length 1000
pool_identity :ApplicationPoolIdentity
logon_type :LogonBatch
idle_timeout "00:20:00"
shutdown_time_limit "00:01:30"
startup_time_limit "00:01:30"
pinging_enabled true
ping_interval "00:00:30"
ping_response_time "00:01:30"
load_balancer_capabilities :HttpLevel
rapid_fail_protection true
rapid_fail_protection_interval "00:05:00"
rapid_fail_protection_max_crashes 5
cpu_action :NoAction
cpu_limit 0
cpu_reset_interval "00:05:00"
smp_processor_affinity_mask 4294967295
smp_processor_affinity_mask_2 4294967295
end

[2015-04-29T08:56:58+12:00] INFO: Running queued delayed notifications before re-raising exception
[2015-04-29T08:56:58+12:00] ERROR: Converge failed with error message iis_pool[TestAppPool](poal_Testwebsite::default line 12) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1413'
---- Begin output of C:\Windows\System32\inetsrv\appcmd.exe set config /section:applicationPools "/[name='TestAppPool'].autoStart:true" "/[name='TestAppPool'].startMode:OnDemand" "/[name='TestAppPool'].managedRuntimeVersion:v2.0" "/[name='TestAppPool'].managedPipelineMode:Classic.capitalize" "/[name='TestAppPool'].enable32BitAppOnWin64:true" "/[name='TestAppPool'].queueLength:1000" "/[name='TestAppPool'].processModel.maxProcesses:" "/[name='TestAppPool'].processModel.loadUserProfile:false" "/[name='TestAppPool'].processModel.logonType:LogonBatch" "/[name='TestAppPool'].processModel.manualGroupMembership:false" "/[name='TestAppPool'].processModel.idleTimeout:00:20:00" "/[name='TestAppPool'].processModel.shutdownTimeLimit:00:01:30" "/[name='TestAppPool'].processModel.startupTimeLimit:00:01:30" "/[name='TestAppPool'].processModel.pingingEnabled:true" "/[name='TestAppPool'].processModel.pingInterval:00:00:30" "/[name='TestAppPool'].processModel.pingResponseTime:00:01:30" "/[name='TestAppPool'].recycling.periodicRestart.time:" "/+[name='TestAppPool'].recycling.periodicRestart.schedule.[value='']" "/[name='TestAppPool'].recycling.logEventOnRecycle:PrivateMemory,Memory,Schedule,Requests,Time,ConfigChange,OnDemand,IsapiUnhealthy" "/[name='TestAppPool'].recycling.periodicRestart.privateMemory:" "/[name='TestAppPool'].recycling.disallowRotationOnConfigChange:false" "/[name='TestAppPool'].recycling.disallowOverlappingRotation:false" "/[name='TestAppPool'].failure.loadBalancerCapabilities:HttpLevel" "/[name='TestAppPool'].failure.orphanWorkerProcess:false" "/[name='TestAppPool'].failure.orphanActionExe:" "/[name='TestAppPool'].failure.orphanActionParams:" "/[name='TestAppPool'].failure.rapidFailProtection:true" "/[name='TestAppPool'].failure.rapidFailProtectionInterval:00:05:00" "/[name='TestAppPool'].failure.rapidFailProtectionMaxCrashes:5" "/[name='TestAppPool'].failure.autoShutdownExe:" "/[name='TestAppPool'].failure.autoShutdownParams:" "/[name='TestAppPool'].cpu.action:NoAction" "/[name='TestAppPool'].cpu.limit:0" "/[name='TestAppPool'].cpu.resetInterval:00:05:00" "/[name='TestAppPool'].cpu.smpAffinitized:false" "/[name='TestAppPool'].cpu.smpProcessorAffinityMask:4294967295" "/[name='TestAppPool'].cpu.smpProcessorAffinityMask2:4294967295" ----
STDOUT: ERROR ( message:Unknown attribute "managedPipelineMode".. Reason: Enum must be one of Integrated, Classic

Compile error for site resource

Recipe Compile Error in c:/chef/cache/cookbooks/iis/resources/site.rb

NameError

undefined local variable or method `iis' for #Class:0x51b8098

Cookbook Trace:

c:/chef/cache/cookbooks/iis/resources/site.rb:32:in `class_from_file'

Relevant File Content:

c:/chef/cache/cookbooks/iis/resources/site.rb:

25: attribute :port, :kind_of => Integer, :default => 80
26: attribute :path, :kind_of => String
27: attribute :protocol, :kind_of => Symbol, :default => :http, :equal_to => [:http, :https]
28: attribute :host_header, :kind_of => String, :default => nil
29: attribute :bindings, :kind_of => String, :default => nil
30: attribute :application_pool, :kind_of => String, :default => nil
31: attribute :options, :kind_of => String, :default => ''
32>> attribute :log_directory, :kind_of => String, :default => "#{iis['pubroot']}\logs\LogFiles"
33: attribute :log_period, :kind_of => Symbol, :default => :Daily, :equal_to => [:Daily, :Hourly, :MaxSize, :Monthly,
:Weekly]
34: attribute :log_truncsize, :kind_of => Integer, :default => 1048576
35:
36: attr_accessor :exists, :running
37:
38: def initialize(*args)
39: super
40: @action = :add
41: end

My attributes from the node are:

"iis": {
"home": "C:\Windows\System32\inetsrv",
"conf_dir": "C:\Windows\System32\inetsrv\config",
"pubroot": "C:\inetpub",
"docroot": "C:\inetpub\wwwroot",
"log_dir": "C:\inetpub\logs\LogFiles",
"cache_dir": "C:\inetpub\temp",

Is there something I am missing?

Chef-client version = 11.12.4
iis cookbook version = 3.0.12

vdir continually tries to add itself

Begin output of C:\Windows\System32\inetsrv\appcmd.exe add vdir /app.name:"Testfu Site/" /path:"/Content/Test" /physicalPath:"C:\wwwroot\shared" /logonMethod:ClearText /allowSubDirConfig:true ----
STDOUT: ERROR ( message:Failed to add duplicate collection element "/Content/Test". )
STDERR: 

Cant add virtual directory to application(as distinct from web site)

Adding a virtual directory now works for me - for example this resource works without issue:

iis_vdir 'Testfu Site/' do
action :add
path '/Content'
physical_path "C:\inetpub\wwwroot\testfu\Content"
end

However when i try to add a virtual directory beneath an application as follows()where the application is simply called '1':

iis_vdir 'Testfu Site/1/' do
action :add
path '/Content'
physical_path "C:\inetpub\wwwroot\testfu\Content"
end

it produces an appcmd command that has an additional trailing slash on the app.name:
Ran C:\Windows\System32\inetsrv\appcmd.exe add vdir /app.name:"Testfu Site/1/" /path:"/Content" /physicalPath:"C:\inetpub\wwwroot\testfu\Content" /logonMethod:C
learText /allowSubDirConfig:true returned 50

Naturally then i tried to remove the trailing slash (in iis_vdir). So my new resource is

iis_vdir 'Testfu Site/1' do
action :add
path '/Content'
physical_path "C:\inetpub\wwwroot\testfu\Content"
end

It results in this error:

[2015-01-06T11:46:35+00:00] FATAL: NoMethodError: iis_vdir[Testfu Site/1](testing-new-iis-cookbook::default line 87) had an error: NoMethodError:
hod `application_name=' for Chef::Resource::IisVdir

Tried this also but no dice:

iis_vdir 'Testfu Site/1/' do
action :add
path 'Content'
physical_path "C:\inetpub\wwwroot\testfu\Content"
end

I also tried explicitly setting the application_name with (application_name "Testfu Site/1/") and without (application_name "Testfu Site/1") while keeping the iis_vdir with its trailing slash(iis_vdir("Testfu Site/1/"))

Perhaps I'm doing something wrong - hopefully I'm not but would be great if someone could take a look and let me know what you think.

:add and :config of app_pool does not change the pipeline_mode

IIS cookbook 4.1 creates the pool but does not set the pool to "Classic" mode. The :config action is reporting in the chef debug logs that there is nothing to change. Multiple runs return the same result for :config.

  • IIS 8.5
  • Chef Client 12.0.1
  • Attributes
default['test_iis']['app_pool'] = 'TestAppPool'
default['test_iis']['app_pool_dotnetversion'] = "2.0"
default['test_iis']['pipelinemode'] = :Classic
default['test_iis']['thirty_two_bit'] = true
  • Recipe
iis_pool "#{node[''test_iis']['app_pool']}" do
  action [:add,:config]
  pipeline_mode node['test_iis']['pipelinemode']
  thirty_two_bit node[''test_iis']['thirty_two_bit']
  runtime_version node[''test_iis']['app_pool_dotnetversion']
end

iis_pool start action isn't working

Here's my pool resource in my recipe:

iis_pool "DB Necromancer" do
  runtime_version "4.5"
  pipeline_mode :Integrated
  action [:add, :start]
end

I was able to start the pool by running appcmd from a Windows Command Prompt window:

appcmd start apppool "DB Necromancer"

Site bindings get overwritten with defaults during :config

When using the bindings attribute of the iis_site resource, subsequent :config actions reset the bindings to http/*:80:

iis_site "foo" do
  bindings        "http/*:80:foo.domain.tld,http/*:80:bar.domain.tld"
  path             "C:\\inetpub\\wwwroot\\foobar"
  application_pool "foobar"
  action [:add, :config, :start]
end

In the iis_site provider, the config action should ignore 'protocol', 'port', and 'host_header' if 'bindings' is specified. This is similar to, but different from #135.

iis_site resource throws error "NomethodError: undefined method 'bindings='

iis_site throws an error "NoMethodError: undefined method `bindings=' for Chef::Resource::IisSite"

Backtrace:
[2015-04-29T09:21:00+12:00] DEBUG: iis_site[Test] current_resource match output: SITE "Test" (id:1,bindings:http/*:80:,state:Started)

Error executing action config on resource 'iis_site[Test]'

NoMethodError

undefined method `bindings=' for Chef::Resource::IisSite

Resource Declaration:

In C:/chef/cache/cookbooks/poal_Testwebsite/recipes/default.rb

62: iis_site "#{node['poal_Testwebsite']['website']}" do
63: protocol :http
64: port 80
65: path "#{node['iis']['docroot']}#{node['poal_Testwebsite']['phypath']}\Sandfield.WorkWith.Web"
66: host_header ""
67: application_pool "#{node['poal_Testwebsite']['app_pool']}"
68: action [:add,:config]
69: end
70:

Compiled Resource:

Declared in C:/chef/cache/cookbooks/poal_Testwebsite/recipes/default.rb:62:in `from_file'

iis_site("Test") do
action [:add, :config]
updated true
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :iis_site
cookbook_name "poal_Testwebsite"
recipe_name "default"
protocol :http
port 80
path "C:\inetpub\wwwroot\Test\Sandfield.WorkWith.Web"
application_pool "TestAppPool"
site_name "Test"
log_directory "C:\inetpub\logs\LogFiles"
log_period :Daily
log_truncsize 1048576
end

[2015-04-29T09:21:00+12:00] INFO: Running queued delayed notifications before re-raising exception
[2015-04-29T09:21:00+12:00] ERROR: Converge failed with error message iis_site[Test](poal_Testwebsite::default line 62) had an error: NoMethodError: undefined method `bindings=' for Chef::Resource::IisSite
[2015-04-29T09:21:00+12:00] DEBUG: Re-raising exception: Chef::Exceptions::RunFailedWrappingError - Found 1 errors, they are stored in the backtrace

  1. NoMethodError - iis_site[Test] (poal_Testwebsite::default line 62) had an error: NoMethodError: undefined methodbindings=' for Chef::Resource::IisSite C:/opscode/chef/embedded/apps/chef/lib/chef/resource.rb:959:in method_missing'
    C:/chef/cache/cookbooks/iis/providers/site.rb:117:inload_current_resource' C:/opscode/chef/embedded/apps/chef/lib/chef/provider.rb:128:in run_action'
    C:/opscode/chef/embedded/apps/chef/lib/chef/resource.rb:561:inrun_action' C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:49:in run_action'
    C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:81:inblock (2 levels) in converge' C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:81:in each'
    C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:81:inblock in converge' C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:83:in block in execute_each_resource'
    C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:incall' C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in call_iterator_block'
    C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:instep' C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in iterate'
    C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:ineach_with_index' C:/opscode/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:81:in execute_each_resource'
    C:/opscode/chef/embedded/apps/chef/lib/chef/runner.rb:80:inconverge' C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:331:in block in converge'
    C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:326:incatch' C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:326:in converge'
    C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:345:inconverge_and_save' C:/opscode/chef/embedded/apps/chef/lib/chef/client.rb:448:in run'
    C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:253:inrun_with_graceful_exit_option' C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:230:in block in run_chef_client'
    C:/opscode/chef/embedded/apps/chef/lib/chef/local_mode.rb:38:inwith_server_connectivity' C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:213:in run_chef_client'
    C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:392:inblock in interval_run_chef_client' C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:382:in loop'
    C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:382:ininterval_run_chef_client' C:/opscode/chef/embedded/apps/chef/lib/chef/application/client.rb:372:in run_application'
    C:/opscode/chef/embedded/apps/chef/lib/chef/application.rb:60:inrun' C:/opscode/chef/embedded/apps/chef/bin/chef-client:26:in <top (required)>'
    C:/opscode/chef/bin/chef-client:64:inload' C:/opscode/chef/bin/chef-client:64:in '

iis_config fails with certain commands

I'd love someone else to verify this:

iis_config "-section:system.webServer/handlers /[name=\'ExtensionlessUrlHandler-Integrated-4.0\'].verb:\"GET,HEAD,POST,DEBUG,PUT,DELETE\"  /commit:apphost" do
    action :config
end

getting this error

==> default: Ran 
C:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/handlers /[name='ExtensionlessUrlHandler-Integrated-4.0'].verb:"GET,HEAD,POST,DEBUG,PUT,DELETE"  /commit:apphost returned 4312

Running the command it says it ran works......

C:\Windows\System32\inetsrv\appcmd.exe set config -section:system.webServer/handlers /[name='ExtensionlessUrlHandler-Integrated-4.0'].verb:"GET,HEAD,POST,DEBUG,PUT,DELETE"  /commit:apphost

error: undefined method `pool_identity`

If you run this cookbook on a brand new windows 2012r2 server, you will get the following error

undefined method pool_identity

==> default: [2015-02-11T12:28:01-08:00] INFO: Chef-client pid: 3812
==> default: [2015-02-11T12:28:10-08:00] INFO: Setting the run_list to ["recipe[ND-Webserver2012]"] from CLI options
==> default:
==> default: [2015-02-11T12:28:10-08:00] INFO: Run List is [recipe[ND-Webserver2012]]
==> default: [2015-02-11T12:28:10-08:00] INFO: Run List expands to [ND-Webserver2012]
==> default: [2015-02-11T12:28:10-08:00] INFO: Starting Chef Run for vagrant-2012-r2.nv.com
==> default: [2015-02-11T12:28:10-08:00] INFO: Running start handlers
==> default: [2015-02-11T12:28:10-08:00] INFO: Start handlers complete.
==> default: ================================================================================
==> default: Recipe Compile Error in C:/tmp/vagrant-chef-3/chef-solo-1/cookbooks/ND-Webserver2012/recipes/default.rb
==> default: ================================================================================
==> default:
==> default: NoMethodError
==> default: -------------
==> default: undefined method `pool_identity' for Chef::Resource::IisPool
==> default:
==> default: Cookbook Trace:
==> default: ---------------
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/resource.rb:300:in `method_missing'
==> default:   C:/tmp/vagrant-chef-3/chef-solo-1/cookbooks/ND-Webserver2012/recipes/default.rb:28:in `block in from_file'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/dsl/recipe.rb:136:in `instance_eval'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/dsl/recipe.rb:136:in `build_resource'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/dsl/recipe.rb:85:in `declare_resource'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/dsl/recipe.rb:41:in `method_missing'
==> default:   C:/tmp/vagrant-chef-3/chef-solo-1/cookbooks/ND-Webserver2012/recipes/default.rb:24:in `from_file'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/mixin/from_file.rb:30:in `instance_eval'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/mixin/from_file.rb:30:in `from_file'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/cookbook_version.rb:234:in `load_recipe'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/run_context.rb:166:in `load_recipe'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:140:in `block in compile_recipes'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:138:in `each'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:138:in `compile_recipes'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/run_context/cookbook_compiler.rb:75:in `compile'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/run_context.rb:89:in `load'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/policy_builder/expand_node_object.rb:73:in `setup_run_context'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/client.rb:265:in `setup_run_context'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/client.rb:429:in `do_run'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/client.rb:227:in `run'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/application.rb:236:in `run_chef_client'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/application/solo.rb:226:in `block in run_application'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/application/solo.rb:218:in `loop'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/application/solo.rb:218:in `run_application'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/application.rb:55:in `run'
==> default:   C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/bin/chef-solo:25:in `<top (required)>'
==> default:   C:/opscode/chef/bin/chef-solo:23:in `load'
==> default:   C:/opscode/chef/bin/chef-solo:23:in `<main>'
==> default:
==> default: Relevant File Content:
==> default: ----------------------
==> default: C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4-x86-mingw32/lib/chef/resource.rb:
==> default:
==> default: 293:      # If an unknown method is invoked, determine whether the enclosing Provider's
==> default: 294:      # lexical scope can fulfill the request. E.g. This happens when the Resource's
==> default: 295:      # block invokes new_resource.
==> default: 296:      def method_missing(method_symbol, *args, &block)
==> default: 297:        if enclosing_provider && enclosing_provider.respond_to?(method_symbol)
==> default: 298:          enclosing_provider.send(method_symbol, *args, &block)
==> default: 299:        else
==> default: 300>>         raise NoMethodError, "undefined method `#{method_symbol.to_s}' for #{self.class.to_s}"
==> default: 301:        end
==> default: 302:      end
==> default: 303:
==> default: 304:      def load_prior_resource
==> default: 305:        begin
==> default: 306:          prior_resource = run_context.resource_collection.lookup(self.to_s)
==> default: 307:          # if we get here, there is a prior resource (otherwise we'd have jumped
==> default: 308:          # to the rescue clause).
==> default: 309:          Chef::Log.warn("Cloning resource attributes for #{self.to_s} from prior resource (CHEF-3694)")
==> default:
==> default: [2015-02-11T12:28:19-08:00] ERROR: Running exception handlers
==> default: [2015-02-11T12:28:19-08:00] ERROR: Exception handlers complete
==> default: [2015-02-11T12:28:19-08:00] FATAL: Stacktrace dumped to C:/var/chef/cache/chef-stacktrace.out
==> default: [2015-02-11T12:28:19-08:00] FATAL: NoMethodError: undefined method `pool_identity' for Chef::Resource::IisPool
Chef never successfully completed! Any errors should be visible in the

recipe/default.rb

iis_pool 'foobar' do
  runtime_version 'v4.0'
  pipeline_mode :Integrated
  thirty_two_bit :true
  pool_identity :SpecificUser
  pool_username 'exampleuser'
  pool_password 'correct-horse-battery-staple'
  action [:add,:start]
end

I'm pretty new to chef, so I'm not sure if this is a bug or a configuration problem.

Setting the default document

The readme.md doesn't specify if this cookbook can set the default document for an application.

Can it alter the default document? If so, I'd like to figure out how, and add it to the readme.

iis_config resource is not idempotent

The IIS_config resource is not idempotent. It will try to apply the same config twice, even if that config is already true. This could result in non-zero output on subsequent runs in the event that a config has already been applied, even though there is nothing wrong with the system state.

Text copied from:
https://tickets.opscode.com/browse/COOK-4359

Example that will fail when client is ran >1 time:
iis_config "/section:httpProtocol /-customHeaders.[name='X-Powered-By']" do
action :config
end

Current implementation of iis_config requires a guard to achieve idempotence.

iis_section unlock fails to unlock authentication section

In my cookbook I'm trying to unlock the IIS windowsAuthentication and anonymousAuthentication sections at the global level but somehow it is not working correctly. I'm running the cookbook against a Win2012R2 server and am installing IIS with the IIS cookbook (version 4.1.0):

include_recipe 'iis'

# Install the ASP.NET 4.5 runtime components
include_recipe 'iis::mod_aspnet45'

# Install the Windows authentication support
include_recipe 'iis::mod_auth_windows'

# install the HTTP logging, logging tools and custom logging
include_recipe 'iis::mod_logging'

# remove the default website
include_recipe 'iis::remove_default_site'

All of that is working successfully.

The code in my cookbook to unlock the authentication sections is:

iis_section 'system.webServer/security/authentication/anonymousAuthentication' do
  action :unlock
  section 'system.webServer/security/authentication/anonymousAuthentication'
end

iis_section 'system.webServer/security/authentication/windowsAuthentication' do
  action :unlock
  section 'system.webServer/security/authentication/windowsAuthentication'
end

The cookbook runs to completion but the sections are just not unlocked.

I also have unlock sections for

iis_section 'system.webServer/handlers' do
  section 'system.webServer/handlers'
  action :unlock
end

iis_section 'system.webServer/modules' do
  section 'system.webServer/modules'
  action :unlock
end

These seem to be working correctly but the authentication section is not working. If I unlock the sections manually then it works. Like this:

powershell_script 'unlock IIS authentication sections' do
  code <<-POWERSHELL
    $ErrorActionPreference = 'Stop'

    $appCmd = 'c:\\windows\\system32\\inetsrv\\appcmd.exe'

    & $appCmd unlock config -section:"system.webServer/security/authentication/anonymousAuthentication" -commit:apphost
    & $appCmd unlock config -section:"system.webServer/security/authentication/windowsAuthentication" -commit:apphost
  POWERSHELL
end

From looking at the iis_section unlock code I think the -commit:apphost bit is missing (see http://serverfault.com/a/360556/239001)?

Compile issue because of encoding on libraries\matcher.rb

@smurawski

knife cookbook upload iis
Uploading iis            [3.0.10]
FATAL: Cookbook file libraries/matcher.rb has a ruby syntax error:
FATAL: /Users/justin/Documents/Code/chef/chef-repo/.chef/../cookbooks/iis/libraries/matcher.rb:70: syntax error, unexpected keyword_end, expecting $end

output of od -c matcher.rb

0000000  357 273 277   i   f       d   e   f   i   n   e   d   ?   (   C

357 273 277 shouldn't be there

apparently multiple files have this now, due to encoding them in Notepad++ as UTF-8

feature request - allow appcmd.exe unlock config

It would be awesome to get some additional functionality around the appcmd.exe utility in this cookbook. For example, appcmd.exe unlock config etc.

I recognize this is a community cookbook, but I don't think I have the expertise to code it, hence the ticket.

iis_vdir - config action appears to ignore the physical_path when constructing appcmd command

Here is my resource:

iis_vdir "teste env1 f/" do
path '/fw7/1/'
physical_path "C:\Websites\teste\env1\f\fw7\repointed"
action :config
end

It returns a message as to say it completed successfully but it did not change the physical path of the application ("teste env1 f/fw7/1").

I would expect that it would produce this appcmd (which when i run manually does change the physical path)
appcmd.exe set vdir "teste env1 f/fw7/1/" -physicalPath:C:\Websites\teste\env1\f\fw7\repointed /logonMethod:ClearText

Before i got this 'working' i had omitted a trailing slash in the path. This error highlighted the fact that the physicalPath appears to be discarded as the code builds up the appcmd command.

Error executing action config on resource 'iis_vdir[teste env1 f/]'

Mixlib::ShellOut::ShellCommandFailed

Expected process to exit with [0], but received '50'
---- Begin output of C:\Windows\System32\inetsrv\appcmd.exe set vdir "teste env1 f/fw7/1" /logonMethod:ClearText ----
STDOUT: ERROR ( message:Must use exact identifer for VDIR object with verb SET. )
STDERR:
---- End output of C:\Windows\System32\inetsrv\appcmd.exe set vdir "teste env1 f/fw7/1" /logonMethod:ClearText ----
Ran C:\Windows\System32\inetsrv\appcmd.exe set vdir "teste env1 f/fw7/1" /logonMethod:ClearText returned 50

Resource Declaration:

In C:/chef/.chef/local-mode-cache/cache/cookbooks/testing-iisapppath/recipes/default.rb

18: iis_vdir "teste env1 f/" do
19: path '/fw7/1'
20: physical_path 'C:\Websites\teste\env1\f\fw7\repointed'
21: action :config
22: end
23:

Compiled Resource:

Declared in C:/chef/.chef/local-mode-cache/cache/cookbooks/testing-iisapppath/recipes/default.rb:18:in `from_file'

iis_vdir("teste env1 f/") do
action [:config]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :iis_vdir
cookbook_name "testing-iisapppath"
recipe_name "default"
path "/fw7/1"
physical_path "C:\Websites\teste\env1\f\fw7\repointed"
application_name "teste env1 f/"
logon_method :ClearText
allow_sub_dir_config true
end

iis_site bindings are not working, documentation could use some examples

There was some discussion in this issue: #95

Version info:

  1. chef-server 12.0.1
  2. client: chef-windows-11.14.2-1.windows.msi
  3. Node is 2008R2.
  4. I'm using the IIS 3.0.4 hotfix branch...https://github.com/EasyAsABC123/iis/tree/hotfix_helper-class

Here is what I'm trying:

 iis_site "#{cookbook_name}" do
    bindings "http/*:80:www.domain.com","https/*:443:"
    action [:config,:restart]
 end

Here's what I get:

nodeName
nodeName ================================================================================
nodeName Recipe Compile Error in c:/chef/cache/cookbooks/CookbookName/recipes/default.rb
nodeName ================================================================================
nodeName
nodeName ArgumentError
nodeName -------------
nodeName wrong number of arguments (2 for 1)
nodeName
nodeName Cookbook Trace:
nodeName ---------------
nodeName   c:/chef/cache/cookbooks/CookbookName/recipes/default.rb:44:in `block in from_file'
nodeName   c:/chef/cache/cookbooks/CookbookName/recipes/default.rb:43:in `from_file'
nodeName
nodeName Relevant File Content:
nodeName ----------------------
nodeName c:/chef/cache/cookbooks/CookbookName/recipes/default.rb:
nodeName
nodeName  37:         path "c:\\web\\data\\#{cookbook_name}"
nodeName  38:         site_name "#{cookbook_name}"
nodeName  39:         application_pool "#{cookbook_name}"
nodeName  40:         action [:add,:start]
nodeName  41:   end
nodeName  42:
nodeName  43:   iis_site "#{cookbook_name}" do
nodeName  44>>        bindings "http/*:80:www.domain.com","https/*:443:"
nodeName  45:         action [:config,:restart]
nodeName  46:   end
nodeName  47:
nodeName  48:
nodeName  49:   # iis_site "#{cookbook_name}" do
nodeName  50:         #path "c:/web/data/#{cookbook_name}"
nodeName  51:
nodeName  52:         # STDOUT: ERROR ( message:Invalid format for parameter "bindings" -
nodeName  53:         # it must be of the following format:
nodeName
nodeName [2015-01-02T10:55:56-05:00] ERROR: Running exception handlers
nodeName [2015-01-02T10:55:56-05:00] ERROR: Exception handlers complete
nodeName [2015-01-02T10:55:56-05:00] FATAL: Stacktrace dumped to c:/chef/cache/chef-stacktrace.out
nodeName [2015-01-02T10:55:56-05:00] FATAL: ArgumentError: wrong number of arguments (2 for 1)

Other pieces of my recipe: (these come before the bindings section)

 iis_pool "#{cookbook_name}" do
    action :recycle
 end

 iis_site "#{cookbook_name}" do
    path "c:\\web\\data\\#{cookbook_name}"
    site_name "#{cookbook_name}"
    application_pool "#{cookbook_name}"
    action [:add,:start]
 end

Oh yeah - and as mentioned in that other issue, would be great to see some examples for the other options like bindings.

iis_app resource - cant change an applications physical path

So i would like to use the iis_app resource to change the physical path on disk that the IIS application points to.
If this functionality is there an example of how to do this would be great.
If not could the functionality be added?

Here is how i imagine it would look - with a config action perhaps:

iis_app "contoso" do
path "/1"
application_pool "myAppPool_v1_1"
physical_path "C:\contoso\1\repointed"
action :config
end

when i use the add variant:

iis_app "contoso" do
path "/1"
application_pool "myAppPool_v1_1"
physical_path "C:\contoso\1\repointed"
action :add
end

I get this error:

---- Begin output of C:\Windows\System32\inetsrv\appcmd.exe add app /site.name:"contoso" /path:"/1" /applicationPool:"myAppPool_v1_1" /physicalPath:"C:\contoso\1\repointed" ----
ERROR ( message:Failed to add duplicate collection element "/fw7/1". )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.