Get the machine url on a deployment to pass it to load balancing script

Hi,

I have a powershell script to remove and add back to an F5 load balancer and I do it on every step for each server group I defined, so I have to repeat the step with each group. I know I can do it with a rolling deployment, but whay I want to know is how can I get the ip (url) of the machine to get it in the script.

Best regards.

Hi,

Thanks for getting in touch. The variable $OctopusParameters['Octopus.Machine.Hostname'] will give you the machine’s host name.

Let me know if this is what you were looking for.

Thanks!

Dalmiro

Hi, but is it possible to get the url, because I need the ip address to send it to a load balancer.

Thanks.

Hi,

You can pass that variable to the static method GetHostAddresses to get the IP of the tentacle:

[System.Net.Dns]::GetHostAddresses("$($OctopusParameters['Octopus.Machine.Hostname'])"

Hope that helps,

Dalmiro

It worked nicely… Thanks a lot!

Best regards.

El 22/04/2015, a las 13:36, Dalmiro Grañas <tender2+df922eee3c@tenderapp.commailto:tender2+df922eee3c@tenderapp.com> escribió: