Getting "Current" Role


I’m currently trying to deploy NServiceBus endpoints. I’ve set the machines up with tags for each endpoint’s package and file name, so “Endpoint.One”, “Endpoint.Two” etc. What I would like to do is access the current tag that’s being deployed.

So, for example, Machine Alpha has been tagged with Endpoint.One and Endpoint.Two. I want two deployments to happen to it, one for each package, and those deployments to be configured based on the Endpoint.One and Endpoint.Two tags, respectively.

Is this possible without making a different process for each tag? I can only find variables which list tags, not select the current one.

Hi Alex,

Thanks for reaching out! Firstly, please correct me if I’ve mistaken anything about your question at all, and feel free to expand upon your scenario if so :slight_smile:

It would require two separate processes to do this with machine roles. If you have a machine with two Roles, and a single step with both of those roles, there’s no way to redeploy the step for both roles. The step will only execute once.

Multi-tenancy sounds like it would be a great option for you to avoid having to create separate processes. By replacing the endpoint tags with Tenant Tags, that would allow you to deploy packages based upon your machine’s Tenant Tags.

I hope that helps!


Hi Kenny,

Looks like a good fit. Thanks :slight_smile:

Hi Kenny,

So I’ve tried to use Tenant Tags but hit an issue. When I set up the package deployment, I can’t use the tenant tag to set the package to download. What I had hoped to be able to do was:

Deploy package #{Octopus.Deployment.Tenant.Name} from Octopus Server (built-in) to machines in roles: Backends

However when creating a release I am prompted to enter a version and cannot just choose “latest”.

Any ideas?

Hi Alex,

Thanks for getting in touch again! There’s a uservoice suggestion and a github issue to add support for this scenario: (Try to leave votes here)

On the latter you’ll find a comment from Michael Noonan explaining the definitely-not-pretty workaround for this. I’m afraid that’s the best that can be done at the moment for this scenario.

Unfortunately we don’t have a specific timeline for when this’ll be supported. Your votes on Uservoice will definitely help though.

Best regards,