IIS Cookbook 5.0.5 - is iis_config Idempotent?

Hi,

I was checking the IIS cookbook version and my few tests shown this resource is not idempotent

 iis_config "\"#{site_name}\" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:\"True\"" do
action :set
end

This resulted in IIS App getting restarted and I replaced it with the below code which seemed to work fine.

powershell_script 'set_anonymous_authentication' do
  guard_interpreter :powershell_script
  'Set-WebConfigurationProperty -Filter "/system.webServer/security/authentication/anonymousAuthentication" -Name Enabled -Value True -PSPath IIS:\\ -Location "#{site_name}"'
  action :run
  not_if '((Get-WebConfiguration -filter "system.webServer/security/authentication/*" -PSPath "IIS:\\Sites\\$iis_app" | where {$_.enabled -eq "true"}).SectionPath).length -gt 0'
end

Is iis_config Idempotent ?

Thanks and Regards,

A

We have been using iis cookbook 4.1.9 since june and we have not noticed any idempotency problems with the iis_config resource.

  iis_config "\"foobar\" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:\"True\" /userName:\"\" /commit:apphost" do
    action :config
  end

Hi,

Thanks for the reply.
My IIS runs a Sitefinity Application. May be it is the application, but I am not sure. When I use the iis_config it results in IIS app getting restarted. However, powerShell works fine. Let me test some more.

Thanks once again.

Best Regards,

A