voxpupuli/puppet-iis

When attempting to remove non-SSL binding, PS command fails

rychannel opened this issue · 1 comments

I set my HTTP binding to absent. The Module didn't remove the binding and failed. I ran the PowerShell command it was running and received the following error.

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 2016.4.2
  • Ruby:
  • Distribution: Windows Server 2012 R2
  • Module version: 2.0.2

How to reproduce (e.g Puppet code you use)

iis::manage_binding {"$uri-http":
ensure => absent,
site_name => 'PhoneDirectory',
protocol => 'http',
port => '80',
ip_address => '*',
host_header => $uri,
}

What are you seeing

Puppet doesn't remove the web binding and fires an error

What behavior did you expect instead

Remove the Web Binding

Output log

Error: Import-Module WebAdministration; Remove-WebBinding -Name "PhoneDirectory"
-Port 80 -Protocol "http" -HostHeader "directory-test.woodmen.net" -IPAddress "
" -SslFlags "0" returned 1 instead of one of [0]
Error: /Stage[main]/Profiles::Dotnet::Webserver::Phonedirectory/Iis::Manage_bind
ing[directory-test.woodmen.net-http]/Exec[DeleteBinding-directory-test.woodmen.n
et-http]/returns: change from notrun to 0 failed: Import-Module WebAdministratio
n; Remove-WebBinding -Name "PhoneDirectory" -Port 80 -Protocol "http" -HostHeade
r "directory-test.woodmen.net" -IPAddress "
" -SslFlags "0" returned 1 instead o
f one of [0]

Any additional information you'd like to impart

I ran the powershell command manually to see if I could get a better idea of why it was breaking.
PS C:\Windows\system32> Import-Module WebAdministration; Remove-WebBinding -Name "PhoneDirectory" -Port 80 -Protocol "ht
tp" -hostHeader "directory-test.rychannel.net" -IPAddress "*" -SslFlags "0"
Remove-WebBinding : A parameter cannot be found that matches parameter name 'SslFlags'.
At line:1 char:157

  • ... -IPAddress "*" -SslFlags "0"
  •                ~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Remove-WebBinding], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.IIs.PowerShell.Provider.RemoveWebBindingCommand

Duplicate - Taken care of in 3.0.0

Closing ticket