Selecting variables

Hi, all!
I have a issue.
I deploy project to ‘Genie Platform Prerelease’ Env and select targets by tag ‘genie.skuFeeder’


image
I use loadbalancer in one of deploy action and choose name for this balancer from variable ‘tg.loadbalancername’


okay. that is easy =)
How do you think what value will be used?
I think that is ‘Gen-Pre-alb-internal’
I’ve checked thi on variables preview page.

But in deplloy process i’ve got another value = ‘Gen-Pre-alb-external’
Okay. i tried to understand logic of selecting variables, but nothing came of itю
At one of moment. I looked for my target in octopus.


Bam!
now, if need change the tags of target, the variable selection behavior will become unpredictable again and need have to make a narrower selection for the scope of variable value.
what will you recommend for this situation?

Hi Vladimir!

Thanks for getting in touch! I’m sorry to hear you’re hitting some confusion here. Octopus determines which variable value will be used based on which value of the variable is most specific to where you’re deploying. Since the variable with value Gen-Pre-alb-external is scoped both to the environment you’re deploying to (genie Platform PreRelease) and your Tentacle has both roles (genie-app which is what the variable is scoped to, and genie.skuFeeder which is the role the step is running on), this value is considered more specific than Gen-Pre-alb-internal for this deployment.

Variable specificity can get quite complex, and we provide some additional information around this concept and how Octopus determines which variables are used in the following doc page and blog post.

You’re correct that a change to the tags of a target can cause unpredictable results when you have variables scoped to these tags. In your scenario, perhaps a good option would be to scope your Gen-Pre-alb-internal variable to your Tentacle itself instead of the role if you want it applicable only for this target machine. As outlined in the previously linked doc page, a variable scoped to a machine is considered more specific than a variable scoped to a role.

I hope this helps for the time being! Don’t hesitate to reach out if you have any further questions or concerns going forward. :slight_smile:

Kind regards,

Kenny

Thanks a lot.
A variable scoped to machine won’t resolve our problem, because we can change count of machines.
If i add genie.skuFeeder scope to variable with Gen-Pre-alb-internal value, can it be helped for our issue. Should i describe all other target tags to this variable?

Sorry, but this problem is very critical for us.
we will want to have a value by default on Environment and specific values for a some deploy processes on same Env. How can we achieve this behavior.

Thanks

Hi Vladimir,

Thanks for following up! I think you’re right on the money. Adding the genie.skuFeeder role scoping to the variable with value Gen-Pre-alb-internal will allow this value to be evaluated when deploying to this machine. Refering to our Scope Specificity section in our docs, scoping to

Roles applied to the current machine and targeted by the current step

is considered more specific and will get precedence over scoping to

Roles applied to the current machine`

I’ve given this a test and it looks like it’ll evaluate as you need to. :slight_smile:

Let me know how you go and if you have any further questions going forward!

Kind regards,

Kenny

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.