citrix / terraform-provider-citrixadc

Part of NetScaler Automation Toolkit | https://github.com/netscaler/automation-toolkit
https://registry.terraform.io/providers/citrix/citrixadc
Apache License 2.0
119 stars 59 forks source link

Can't add server name to service group members #26

Closed Priteshkal closed 5 years ago

Priteshkal commented 5 years ago

Hi,

I am trying to add a specific server name when I try to add a service group member to a service group using terraform. I see in the code for service group that currently the only things that are being parsed out from the arguments are: IP Address, Port and Weight.

servicegroupMembers := make([]string, 0, len(boundMembers))
    for _, member := range boundMembers {
        ip := member["ip"].(string)
        port := member["port"].(float64) //TODO: why is this not int?
        weight := member["weight"].(string)
        strmember := fmt.Sprintf("%s:%.0f:%s", ip, port, weight)
        servicegroupMembers = append(servicegroupMembers, strmember)
    }
    d.Set("servicegroupmembers", servicegroupMembers)

Can we have the ability to add a server name to this list so that its easier to find the servers in a service group by their names rather than IP address?

There is an argument that could be passed in the API call to add a server name: d.Set("servername", data["servername"])

Thanks

Priteshkal commented 5 years ago

Hi,

Is there any update on this?

Thanks

Priteshkal commented 5 years ago

Trying to follow up on this? Anything new for this?

olljanat commented 5 years ago

@Priteshkal unfortunately it looks to be that this provider is not actively developed by Citrix.

Anyway, if you create PR of that change based on contributing guideline it will get merged (I have got some which was important for us).

giorgos-nikolopoulos commented 5 years ago

The following PR ( #29 )adds the ability to define servicegroup members by using the servername.

Let us know if this solution fits your needs.

Priteshkal commented 5 years ago

Hi,

Thank you for making this PR. I tried using this provider but here is what I noticed:

1) When I add server to the service group using IP, the provider is able to create a new server where the servername and ip are both the ip address. 2) When I try to add server to the service group using servername, the provider does not create a new server and hence its not able to bind the server to the service group unless a server with that name already exists on the netscaler.

The functionality that I was looking for in my automation was the ability to create a server with a servername and an IP . (both together) and to add it to my service group on creation of my VM.

I see in the code that there are if/else clause which makes it so that we can either add a server by IP or by servername but not make a server by using both those attributes together.

Is there any way we could reopen this issue to add that ability?

Thanks