Machine in Role Feature not working

Hi,

I need a list of servers in which content is deployed to but I am unable to get it using Octopus.Environment.MachinesInRole[role],

What is the best way to get this list, this list is required for F5 Load Balancer Operations

Hi Kumar,

Thanks for reaching out. Exactly which information about the machines are you looking for?

  • The computer name set in windows (what you would get by running $env:computername in powershell on the machine)

  • The name of the Tentacle in Octopus.

  • The URL/IP of the machine,

Let me know what you are looking for to pass to your F5 Load balancer and I’ll give you a hand fetching that info.

Thanks,
Dalmiro

Hi Dalmiro,

I want all the Octopus.Machine.Name where the content is being deployed.

Thanks,
Nitin

Hi Dalmiro,

Any updates ?

Thanks,
Nitin

From: Dhir, Nitin Kumar
Sent: Wednesday, June 01, 2016 5:05 PM
To: 'Dalmiro Grañas’
Subject: RE: Machine in Role Feature not working [Problems #46090]

Hi Dalmiro,

I want all the Octopus.Machine.Name where the content is being deployed.

Thanks,
Nitin

Hi Nitin,

Sorry for the delay here. The variable Octopus.Environment.MachinesInRole[_role_] will only return the IDs of the machines (e.g Machines-101) instead of the name which is what you are looking for.

I wrote an API script for your scenario that will help you look for machines in the current environment with a specific role. The good thing about this script is that you can run it from the Octopus server and It’ll still work.

Let me know if it makes sense and helps.

Best regards,
Dalmiro