terraform-provider-bigip
                                
                                 terraform-provider-bigip copied to clipboard
                                
                                    terraform-provider-bigip copied to clipboard
                            
                            
                            
                        Determine which is active in HA pair
One of the challenges we face for any automation is that we run our F5s as an active passive pair it would be good if there was a way using a data resource to capture the active passive - its available through
curl -s -k -u user:passwd https://F5-name/mgmt/tm/shared/bigip-failover-state
returns:
{"isEnabled":true,"pollCyclePeriodMillis":3600000,"nextPollTime":"2019-02-26T09:57:08.067+0000","networkFailoverDeviceGroup":"device-group-failover","failoverState":"active","generation":0,"lastUpdateMicros":0}
or/
{"isEnabled":true,"pollCyclePeriodMillis":3600000,"nextPollTime":"2019-02-26T09:56:24.724+0000","networkFailoverDeviceGroup":"device-group-failover","failoverState":"standby","generation":0,"lastUpdateMicros":0}
This could then be used to then drive the provider choice for subsequent activities.
we have a similar configuration, but configuration changes can be apllied on either the active or passive node since they sync each other, it's what we do and we don't have any issue with that.
What is your concern?
We don't run our F5's in production with automatic sync, instead we trigger a sync once all the changes are applied.
I see, well... even if you had this data source I don't think you can use that, since terraform provider configuration section doesn't support interpolation.
how did you want to take advantage of this?
FYI, this PR will allow you to get the list of devices in the cluster. You'll have to then look at the FailoverState attribute to see if it's active or standby: https://github.com/f5devcentral/go-bigip/pull/22
potentially, the provider may query for the active device before each CRUD operation and determine which device to use for the actual CRUD API call.
This would however make things a bit ambiguous, as you would be putting one address in provider and instead it would go to another (also need to consider Standalone configuration).
Additional issue is that some resources are not "sync-able" and need to be defined on each device, i.e. Vlan and local Self IPs (maybe others - not sure).
we currently use provider aliases to set these up on each device as required.
Hi, closing this request now. Please re-open if required or send an email to [email protected]. Thanks!