View Step Output Just From Servers With a Particular Role?

I know it’s possible to view Step output vars from a separate step by the machine name:

$OctopusParameters['Octopus.Action[Step Name].Output[Machine-Name].VarName']

but is it possible to reference the output of a machine based upon its role?

Hi Jonathan,

Thanks for getting in touch! Unfortunately I’m not fully understanding exactly what you’re after. Would you be able to expand a bit on what you’re looking to achieve and your requirements?

Based on some assumptions on my part, perhaps some ideas that could help would be:

  1. Use both the Machines and MachinesInRole system variables which you can iterate through. You can see details of the available system variables in our docs.
    https://octopus.com/docs/deploying-applications/variables/system-variables#Systemvariables-Deployment

  2. Build up your output variables in a convention and look them up in that way. For example, if you have roles web and db, name your output variables webExample and dbExample.

Let me know if this helps at all, or if I’ve made any incorrect assumptions. :slight_smile:

Best regards,

Kenny