Non-HTTP/HTTPS site bindings are not able to be changed, but are attempted to be removed - #68
Non-HTTP/HTTPS site bindings are not able to be changed, but are attempted to be removed#68KBerstene wants to merge 7 commits into
Conversation
|
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 4m 02s |
8e99c91 to
fb5824c
Compare
|
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 43s |
|
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 50s |
|
My apologies for the multiple pushes; I'm trying to figure out why the Windows Server tests are failing. Piping an object into |
…perty instead of parens+.properties
|
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 24s |
|
My apologies, I cannot figure out why the tests are failing. It is as though the |
|
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 20s |
…)"` into `Set-WebBinding -Name $site.Name` in order to eliminate IndexOf and pass tests
|
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 29s |
|
Okay, I've converted to using |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
So the test that is failing is this one microsoft.iis/tests/integration/targets/website/tasks/bindings.yml Lines 80 to 115 in 925c496 Specifically it is this check (and subsequent assertions for this binding) that is failing {
"changed": false,
"exists": true,
"site": [
{
"application_pool": "TestWebSitePool",
"bindings": [
{
"certificate_hash": "",
"certificate_store_name": "",
"hostname": "acme.com",
"ip": "127.0.0.1",
"port": 8080,
"protocol": "http",
"use_ccs": false,
"use_sni": false
},
{
"certificate_hash": "",
"certificate_store_name": "",
"hostname": "microsoft.iis.website.com",
"ip": "127.0.1.1",
"port": 8091,
"protocol": "http",
"use_ccs": false,
"use_sni": false
},
{
"certificate_hash": "",
"certificate_store_name": "",
"hostname": "microsoft.iis.website.net",
"ip": "127.0.2.1",
"port": 8092,
"protocol": "http",
"use_ccs": false,
"use_sni": true
}
],
"name": "TestWebSite",
"physical_path": "C:\\wwwroot\\websites\\my-test-website-alt",
"site_id": 99,
"state": "Started"
}
]
}We can see that This would indicate that the changes made in this PR has broken the logic for adding/modifying a HTTPS binding. It seems like in this case it's actually modifying an existing binding by changing |
SUMMARY
Non-HTTP/HTTPS site bindings, such as
net.tcp, are not able to be changed using thewebsitemodule, but the module attempts to remove them, since they cannot be listed in the list of bindings to set.ISSUE TYPE
COMPONENT NAME
plugins/modules/website.ps1ADDITIONAL INFORMATION
I have an IIS server running Exchange. It uses several types of protocols:
http,https,net.tcp,net.pipe, and others. When trying to configure bindings, the only options available arehttpandhttps. Currently the way that existing site bindings are populated is using a method that will list all bindings, regardless of protocol. Example here:Since
net.tcpand the other unsupported protocols cannot be added to the bindings list in a task, they will get added to the$toRemovelist andHere is an example task:
Additionally, since the way the bindings filtered into
$toRemoveare removed does not include a protocol and only works off of thebindingInformation, this can remove the HTTP and HTTPS bindings that were just modified.This can be fixed by modifying the way that existing site bindings are populated so that it filters the bindings by only the supported protocols. Alternatively, it could be changed to use theGet-WebBindingcmdlet instead, but that will only pull up three protocols: HTTP, HTTPS, and FTP. There may be another way to edit thenet.tcpand other protocols if needed, but they're not available using that method.This does mean that the bindings list will not perfectly reflect the list of bindings passed into
set:, but since the module does not support other protocols at this time (e.g. FTP is feature requested in #42), the options are either to remove configurations we can't modify or ignore them—this is the "ignore them until they're supported" option.Edit: It turns out that there's an issue that the tests have hung up on that means that the IndexOf at line 255 appears to be invalid? I can't figure out why, so I've converted to using
Get-WebBindingandSet-WebBindingbecause it can edit the correct binding without having to use an indexing function likeSet-ItemPropertyrequires.