So I’m trying to find a way to get the deployment target IPs and pass them to our NLB.
The current setup is, we deploy to three targets. 1 Backend, 2 Frontend Servers.
Now I want to get the IP’s from the 2 FE servers but they are known only by their internal hostnames (fe1.infra.myorg.com) in the deployment target (tentacle url is fe1…etc…:port).
How can I get all IP Adresses of our 2FE Servers and store them in a variable? This has to be done via script because we have about 250 FE Servers running. So setting variables for this doesnt make sense
I found something like this:
$ipV4 = Test-Connection -ComputerName (hostname) -Count 1 | Select IPV4Address Set-OctopusVariable -name "IPV4Address" -value $ipV4.IPV4Address
I guess this script would run “on each deployment target”. But this would overwrite itself as soon as it is run on the other FE instance… The targets have a “frontend-server” role, so running only in fe is not an issue… Just the saving of the variable.
OR, if you have another Idea… Let me know if there is a better way to do it.
Greets & Thanks.