Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
puppetlabs-iis 4.2.0
-
-
Windows
-
1
-
Windows 2019-03-27
-
Manual Test
-
Major
-
3 - 25-50% of Customers
-
3 - Serious
-
4 - $$$$$
-
Customers expect our IIS module to work and it cannot manage this resource like it does on other operating systems.
-
Needs Assessment
Description
The provider fails to ensure absent.
This is a known issue with Remove-WebVirtualDirectory which is called by the provider.
Given:
iis_virtual_directory { 'unc':
|
ensure => 'absent',
|
sitename => 'Default Web Site',
|
physicalpath => '\\\\SERVER\\share',
|
}
|
The provider fails:
PS C:\> puppet agent -t
|
...
|
Debug: Destroying unc
|
Debug: COMMAND: Remove-WebVirtualDirectory -Name "unc" -Site "Default Web Site" -Application "/" -ErrorAction Stop
|
Debug: Waited 50 milliseconds...
|
...
|
Debug: Wait object signaled
|
Debug: Waited 0.140371 total seconds.
|
Debug: STDOUT: remove-item : The method or operation is not implemented.
|
At line:1 char:1
|
+ Remove-WebVirtualDirectory -Name "unc" -Site "Default Web Site" -Application "/" ...
|
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
+ CategoryInfo : NotSpecified: (:) [Remove-Item], NotImplementedException
|
+ FullyQualifiedErrorId : System.NotImplementedException,Microsoft.PowerShell.Commands.RemoveItemCommand
|
|
Notice: /Stage[main]/Main/Node[pe-201722-agent-win2012]/Iis_virtual_directory[unc]/ensure: removed
|
...
|
For reference, the same PowerShell command on the command line:
PS C:\> Remove-WebVirtualDirectory -Name "unc" -Site "Default Web Site" -Application "/" -ErrorAction Stop
|
|
Confirm
|
The item at IIS:\Sites\Default Web Site\\unc has children and the Recurse parameter was not specified. If you continue, all children will be removed with the item. Are you sure you want to continue?
|
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
|
Remove-WebVirtualDirectory offers no Recurse parameter, and it is probably calling Remove-Item.
Two possible solutions:
# Use Remove-Item
|
Remove-Item 'IIS:\\Sites\\#{@resource[:sitename]}\\#{@resource[:name]}' -Recurse
|
# Set physicalPath to a temporary empty directory.
|
empty_temp_directory = 'c:\windows\temp\empty_physical_path_directory'
|
New-Item -ItemType Directory '#{empty_temp_directory}'
|
Set-ItemProperty -Path 'IIS:\\Sites\\#{@resource[:sitename]}\\#{@resource[:name]}' -Name 'physicalPath' -Value '#{empty_temp_directory}'
|
Remove-WebVirtualDirectory ...
|
Remove-Item '#{empty_temp_directory}'
|
Attachments
Issue Links
- relates to
-
MODULES-6061 IIS : iis_virtual_directory fails to update site and application
-
- Closed
-
-
MODULES-6061 IIS : iis_virtual_directory fails to update site and application
-
- Closed
-