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