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!

    Otter 3 - Error This operation is only valid when run against an SSH agent.

    Scheduled Pinned Locked Moved Support
    9 Posts 3 Posters 22 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.
    • P Offline
      philippe.camelio_3885
      last edited by

      Hi
      I have some error when I tried to run some Otterv2 working scripts on Otter 3 😠

      Define a server (as SSH Agent Type) : VM111021
      Create an Otter Module called AnsiblePlaybook

      ##AH:UseTextMode
      module AnsiblePlayBook<$PLAYBOOK = $Tolower($ApplicationName), %EXTRAVARS = %(env:$ToLower($PipelineStageName)), $YML = main.yml, $RQUIRE = requirements.yml, $Branch = master, $Role = OUI, $GitGroupe = ansible/playbooks>
      {
          Log-Debug PLAYBOOK = $PLAYBOOK;
          Log-Debug Role = $Role;
          set %EXTRAVARS = %MapAdd(%EXTRAVARS, v, 0);
          set $DOSSIER = /tmp/ANSIBLE/$PLAYBOOK;
          set $EXTRAFILE = $DOSSIER/extravars.json;
          Log-Debug ******** $ToJson(%EXTRAVARS);
          Ensure-Directory $DOSSIER
          (
              Exists: false
          );
          Log-Debug BEFORE;
          SHExec git config --global http.sslVerify false;
          Log-Debug AFTER;
       if false   
      {
      # Other stuff I would like to run
      }
      }
      

      Create an Otter Plan called Create-NewVM

      ##AH:UseTextMode
      ##AH:Description Deploiement d'une VM Γ  partird'un template
      set $NbVM=1;
      set $YML=create-linux.yml
      set $octet2 = 100;
      set $octet3 = 10;
      set $template = GI-DCS-UBUNTU-20.04.1-20210121;
      set $annotation = $Date - Creation de la VM  / Template : $template;
      # CrΓ©ation d'un VM Linux
      for server VM111021
      {
          # Loop
          foreach $VM in @Range(1, $NbVM)
          {
              call AnsiblePlayBook
              (
                  PLAYBOOK: vmware,
                  EXTRAVARS: %(octet2:$octet2,octet3:$octet3,template:$template,annotation:$annotation'),
                  YML: $YML,
                  Role: NON
              );
          }
      }
      

      This script is working fine on Otter 2 but on Otter 3 ...

      DEBUG: 2021-05-03 16:19:28Z - Job will be run against servers sequentially (not asynchronously).
      DEBUG: 2021-05-03 16:19:28Z - Targeting servers: VM111021
      DEBUG: 2021-05-03 16:19:28Z - Beginning execution run...
      DEBUG: 2021-05-03 16:19:28Z - PLAYBOOK = vmware
      DEBUG: 2021-05-03 16:19:28Z - Role = NON
      DEBUG: 2021-05-03 16:19:28Z - ******** {"octet2":"100","octet3":"10","template":"GI-DCS-UBUNTU-20.04.1-20210121","annotation":"2021-05-03T18:19:28 - Creation de la VM  / Template : GI-DCS-UBUNTU-20.04.1-20210121'","v":"0"}
      DEBUG: 2021-05-03 16:19:28Z - Looking for /tmp/ANSIBLE/vmware...
      DEBUG: 2021-05-03 16:19:29Z - Directory does not exist.
      DEBUG: 2021-05-03 16:19:29Z - BEFORE
      ERROR: 2021-05-03 16:19:29Z - This operation is only valid when run against an SSH agent.
      DEBUG: 2021-05-03 16:19:29Z - Script exited with code: 0
      ERROR: 2021-05-03 16:19:29Z - Execution run failed.
      DEBUG: 2021-05-03 16:19:29Z - Cleaning up temporary files on Linux/SSH (10.100.111.21:22)...
      1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer
        last edited by

        Hello,

        I'm not able to reproduce this case at all 😒

        The message "This operation is only valid when run against an SSH agent." is logged if you try to run SHEXec against a non-linux server, and I can consistently reproduce that.

        But when I switch to an SSH server, it works totally fine...

        I wonder if there's something simpler at play, like the wrong $ServerName is in context or something? Nothing seems thtat way from the codes you shared, but.... can you try a very simple repro case, like an OtterScript that looks like....

        for server myLinuxServer
        {
            SHExec echo hello world;
        }
        

        Thanks,
        Alana

        P 2 Replies Last reply Reply Quote 0
        • P Offline
          philippe.camelio_3885 @atripp
          last edited by philippe.camelio_3885

          @atripp said in Otter 3 - Error This operation is only valid when run against an SSH agent.:

          I have made a test.
          I also made a Configuration Plan (Ensure Directory which works).

          for server VM111021
          {
              SHExec echo hello world;
          }
          

          e67f1995-a8cd-4a8e-a1b8-075380d6a2ec-image.png

          efb6744b-e42b-4643-93c2-743f2014dab2-image.png

          03e377a5-c327-4561-8b30-fbd8c8175841-image.png

          1 Reply Last reply Reply Quote 0
          • P Offline
            philippe.camelio_3885 @atripp
            last edited by philippe.camelio_3885

            @atripp
            Hi,
            I have made a second test with a second Linux Server with the same result
            6eee0118-0a4c-470c-987c-5472b31139fa-image.png

            1 Reply Last reply Reply Quote 0
            • atrippA Offline
              atripp inedo-engineer
              last edited by

              FYI; we're going to investigate this some more, and will try to see why it's happeing here, but not for meπŸ™„

              P 1 Reply Last reply Reply Quote 0
              • P Offline
                philippe.camelio_3885 @atripp
                last edited by

                @atripp πŸ‘

                1 Reply Last reply Reply Quote 0
                • gdivisG Offline
                  gdivis inedo-engineer
                  last edited by

                  We've got a fix for this as OT-415. It will be included in Otter v3.0.6. If you'd like, I can publish a prerelease version for you. Thank you!

                  P 1 Reply Last reply Reply Quote 0
                  • P Offline
                    philippe.camelio_3885 @gdivis
                    last edited by philippe.camelio_3885

                    @gdivis
                    Oh thanks but I will wait for the release.I won't have so much time to test the week.

                    1 Reply Last reply Reply Quote 0
                    • P Offline
                      philippe.camelio_3885
                      last edited by

                      @gdivis
                      Thanks for the resolution

                      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