Hi, we have a site made of several .Net applications which we are deploying using Octopus Deploy. Now we have variables in library variable sets where variables have been scoped by environment and roles, however, some environments have only one server which has more than one role.
What I have noticed is that even if the steps in deployment project are scoped to one role, when the variables are evaluated and the server has more than one role, then the evaluation is non deterministic and unexpected values end up in the configuration files being introduced by the variable replacement feature.
Thanks for getting in touch! This is by design, what you have probably found is that in any of these combinations you could have expected different results. While I could go into details here it is probably better explained by this blog post. https://octopus.com/blog/variable-specificity-and-complexity
This will show you the different issues around variable scoping.
Sorry that it has caused this confusion even internally sometimes we debate about what should be expected.