Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Incorrect Environment Level Variables Used

    Scheduled Pinned Locked Moved Support
    variablesotter
    10 Posts 1 Posters 20 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      Hi,

      I'm evaluating Otter and there seems to be an issue with the way variables are being evaluated when they are assigned at the Environment level. Say I have 3 environments:

      • Development
      • Testing
      • Production

      If I assign a $TestValue variable to each environment with a different value for each one, then I expected that the variables would be evaluated based on which environment the server was in when I run a plan. This doesn't appear to be the case however because every time I execute a plan the value from the "Development" environment is used.

      For example, if I set the following values for the $TestValue variable:

      • Development: DevelopTestValue
      • Testing: TestingTestValue
      • Production: ProductionTestValue

      and I run a plan that logs the values, the output is always "DevelopTestValue" even if the server is in the Testing environment. Am I misinterpreting how variables work or is this some type of bug.

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        This may be a bug, or perhaps it's part of the way environment scoping works (we're planning to update this to be more intuitive soon). Can you submit a ticket and attach your Variables (Admin > Variables > Json), Infrastructure (Admin > Export Infrastructure), and Plan text?

        Then we will try to reproduce and update from there!

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          Sorry to tag on to a month-old question, but i'm finding the same thing. Two different environments have the same variables with different values, but when an Orchestration Job is run for two servers, one in each environment, they both choose the same value.

          If its any help... variables were using the values from Environment A, so I deleted all variables from A so the plan would use Environment B. Then when adding the variables back to plan A, only the variables from B were used for both servers.

          Did anything ever come of this topic or is it a setup problem?

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            Apologies for the delay - but both cases are indeed bugs that are fixed internally and the fix will be shipped today.

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              Tod -

              Thanks for the update, but after upgrading to 1.5.4 the same Orchestration Plan doesn't appear to look at environment variables anymore when run targeting a server in that environment. The plan errors out with "Could not resolve variable $xxx".

              The same plan was working in 1.5.3, just with incorrect variables.

              1 Reply Last reply Reply Quote 0
              • ? This user is from outside of this forum
                Guest
                last edited by

                Is the server assigned to multiple environments? If it's only assigned to a single one, then the value for that one environment is used. If a server is assigned to multiple environments, then its values are not considered at all resulting in the "could not resolve" error message.

                For that case, you can always assign a system-level variable with a default value of <empty> or something like that.

                1 Reply Last reply Reply Quote 0
                • ? This user is from outside of this forum
                  Guest
                  last edited by

                  The server itself is only in one environment, but has multiple roles which span multiple environments. These variables aren't defined in roles so I would think they should still look to the environment of the server.

                  1 Reply Last reply Reply Quote 0
                  • ? This user is from outside of this forum
                    Guest
                    last edited by

                    My apologies... I missed the "orchestration" part and assumed "configuration" plan. What I said applies to configuration plans since those are guaranteed to be in the context of a server (or role) from the start whereas orchestration jobs can target servers, roles or environments, and each can be conflated contextually (think server is in multiple roles and each role or the server itself is associated with a different environment) within the plan at any time. The definite wrong thing to do in that scenario is pick a random environment variable as it was before :)

                    That being said, for Orchestration Jobs, the job must target a single environment in order to include the environment's variables in the execution.

                    1 Reply Last reply Reply Quote 0
                    • ? This user is from outside of this forum
                      Guest
                      last edited by

                      Are environment variables not brought into context then in an Orchestration Plan when targeting only servers? Only when you specifically target the entire environment? (This at least appears to be the behavior now) I can resolve the variables when running the plan to target the environment. I was targeting by servers before because I don't want the plan to run for all servers or roles every single time. But, targeting by Environment, then by Role may be the answer.

                      Maybe my understanding for scoping was off and I need to restructure our setup. Thanks for your time.

                      1 Reply Last reply Reply Quote 0
                      • ? This user is from outside of this forum
                        Guest
                        last edited by

                        Just as a follow-up, we are going to clarify this behavior and "fix" it to be more like your use-case, see:

                        http://inedo.com/support/questions/6290#inline-post-6291

                        1 Reply Last reply Reply Quote 0

                        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                        With your input, this post could be even better 💗

                        Register Login
                        • 1 / 1
                        • First post
                          Last post
                        Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation