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!

    Targeting an Orchestration Job to an Environment or Plan - am I missing something?

    Scheduled Pinned Locked Moved Support
    templatesdeployment-plansotter
    2 Posts 2 Posters 25 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

      I have been evaluating Otter recently, but am coming up against a problem. To simplify it to its basic level, I don't think assigned Roles are being correctly determined when running Plans, which is having a knock-on effect on determining which Server is in scope when using Plans that target a Role or Envrionment.

      In my evaluation environment, I have a Role, DatabaseServer, and a small Environment hierarchy which represents an application:

      • App
        • App Live
        • App SIT
        • App UAT

      So far, I have defined a Server Server001, and assigned it to the App SIT environment and DatabaseServer role.

      I build an Orchestration Plan -- which, to simplify the problem, just logs various variables:

      Log-Information Current = $ToJson(%(Server: $ServerName,
                                          Environment: $EnvironmentName,
                                          Role: $RoleName,
                                          IsSimulation: $IsSimulation));
      
      Log-Information ServersIn = $ToJson(%(Env: @ServersInEnvironment(), 
                                            Role: @ServersInRole(), 
                                            RoleAndEnv: @ServersInRoleAndEnvironment()));
      
      Log-Information All = $ToJson(%(Envs: @AllEnvironments(), 
                                      Roles: @AllRoles(), 
                                      Servers: @AllServers()));
      

      From here, I use the tie(?) icon to create a number of jobs, each targeting in different ways:

      1. If I target Server001 specifically, the result seems to show the server and environment correctly, but not the role:

        Skipping collection run; execute only.
        Collection run succeeded.
        Beginning execution run...
        Current = {"ServerName":"Server001","Environment":"App SIT","Role":"","IsSimulation":"true"}
        ServersIn = {"Env":["Server001"],"Role":[],"RoleAndEnv":[]}
        All = {"Envs":["App","App Live","App SIT","App UAT"],"Roles":["DatabaseServer"],"Servers":["LOCALHOST","Server001"]}
        Cleaning up temporary files on Inedo Agent (v??, Server001:46336)...
        Execution run complete.
        Execution run succeeded.
        
      2. If I target the DatabaseServer role specifically, I don't get any matched server, environment or role:

        Skipping collection run; execute only.
        Collection run succeeded.
        Beginning execution run...
        Current = {"Server":"","Environment":"","Role":"","IsSimulation":"true"}
        ServersIn = {"Env":[],"Role":[],"RoleAndEnv":[]}
        All = {"Envs":["App","App Live","App SIT","App UAT"],"Roles":["DatabaseServer"],"Servers":["LOCALHOST","Server001"]}
        Execution run complete.
        Execution run succeeded.
        
      3. If I target the App SIT environment, the result shows the environment, but empty server and role values:

        Skipping collection run; execute only.
        Collection run succeeded.
        Beginning execution run...
        Current = {"Server":"","Environment":"App SIT","Role":"","IsSimulation":"true"}
        ServersIn = {"Env":[],"Role":[],"RoleAndEnv":[]}
        All = {"Envs":["App","App Live","App SIT","App UAT"],"Roles":["DatabaseServer"],"Servers":["LOCALHOST","Server001"]}
        Execution run complete.
        Execution run succeeded.
        
      4. If I target both the App SIT environment and the DatabaseServer role (by filling in both fields), I get the same as in #3.

      I believe this is causing my overall problem, where Jobs that apply Plans targeting Servers are successful, but those that target Roles and/or Environments are failing with This operation requires a valid server context. Use a "for server ..." block to set the server context., but I don't know how to resolve this. I thought I might have to use a Loop block to iterate over @ServersInRoleAndEnvironment, but this list variable appears to be empty in all the above cases, so I'm not sure where to go here.

      This seems (to me) like a fundamental thing that Otter should do for me, so I must be missing something obvious, but I just can't seem to reason about it.

      Product: Otter
      Version: 2.0.12

      1 Reply Last reply Reply Quote 0
      • jraschJ Offline
        jrasch inedo-engineer
        last edited by

        Hi Jim,

        Apologies for the lack of response here, but I wanted to let you know that we had quite a bit of back-and-forth internally on this post and implemented nearly all of your expectations:

        1. you are absolutely correct about the variable context not behaving as expected, and
        2. the biggest problem was that the behavior of certain variables (particularly $RoleName) was undefined
        3. we've updated the docs to reflect the "new" behavior in the latest version (v2.1.0 at the time of this post): https://inedo.com/support/documentation/otter/core-concepts/jobs#orchestration-job-context
        4. we release v2.1.0 last night with these changes included

        Thank you again for the detailed report and reproduction steps.

        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