this causes any comma separated list passed to the ip_address parameter to be treated as a whole single string.
ex: ip_address: 10.10.10.1, 10.10.11.1
what get's passed to the underlying dbatools function, add-dbaaglistener, is a string value that looks like "10.10.10.1, 10.10.11.1" which returns an error "...invalid IP address..."
37│ msg: 'Configuring availability group listener failed: Cannot process argument transformation
38│ on parameter ''IPAddress''. Cannot convert value "10.10.10.1,10.10.11.1"
39│ to type "System.Net.IPAddress[]". Error: "Cannot convert value "10.10.10.1,10.10.11.1"
40│ to type "System.Net.IPAddress". Error: "An invalid IP address was specified.""'
in our case the IP address were being passed to this module as ansible variables
Describe the bug when creating a multi-subnet AG listener you are required to pass in a comma separated list of IP addresses to the ip_address parameter, however the ip_address parameter is being handled as a type = 'str' in https://github.com/lowlydba/lowlydba.sqlserver/blob/main/plugins/modules/ag_listener.ps1
this causes any comma separated list passed to the ip_address parameter to be treated as a whole single string.
ex: ip_address: 10.10.10.1, 10.10.11.1
what get's passed to the underlying dbatools function, add-dbaaglistener, is a string value that looks like "10.10.10.1, 10.10.11.1" which returns an error "...invalid IP address..."
To Reproduce
you will receive the following output
in our case the IP address were being passed to this module as ansible variables
Expected behavior we expected this to create a multi subnet AG listener utilizing both IP addresses
Versions(please complete the following information):
Additional context I validated that changing line 18 of ag_listener.ps1 to accept a list instead of a string fixes this issue https://github.com/lowlydba/lowlydba.sqlserver/blob/main/plugins/modules/ag_listener.ps1
the change does require that when sending multiple IP address to the module that you send a valid list parameter
ex: