Navigation

    Inedo Community Forums

    Forums

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. vaclav.nadrasky_0945
    3. Posts
    V
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by vaclav.nadrasky_0945

    • Proper use of try catch in configuration plans

      Hello.
      I'm struggling to properly send a notification in case something bad happens in a configuration job. Example of a simple configuration plan that simulates this:

      ##AH:UseTextMode
      
      try
      {
          Ensure-File C:\Temp\ensure.txt
          (
              Text: This is just a simple ensure action.
          );
      
          Start-Service missing_service
          (
              FailIfServiceDoesNotExist: true
          );
      }
      catch
      {
          Post-Http $webookUrl
          (
              ContentType: application/json, TextData: '{"text": "Failure"}'
          );
      }
      

      Message is never send. I assume it is because a configuration drift occurred in a "try" block so no other blocks are executed. I am able to resolve this issue by placing the post action inside a block with an execution policy set to always:

      ##AH:UseTextMode
      
      try
      {
          Ensure-File C:\Temp\ensure.txt
          (
              Text: This is just a simple ensure action.
          );
      
          Start-Service missing_service
          (
              FailIfServiceDoesNotExist: true
          );
      }
      catch
      {
          # CachAlwaysBlock
          with executionPolicy=always
          {   
              Post-Http $webookUrl
              (
                  ContentType: application/json, TextData: '{"text": "Message B"}'
              );
          }
      }
      

      It works. But the problem now is that when I switch plan to a visual editor and than back to the text mode again the whole "with" statement disappear. So it's very dangerous to use it.

      Maybe I got it all wrong and there is a better way how to automatically inform my team that something bad had happened. But if such a mechanism exists in Otter, I'm no aware of it.

      Is "with executionPolicy=always" a bad idea to use and there is a better way of handling failures, or is it the only way?

      posted in Support
      V
      vaclav.nadrasky_0945
    • RE: Otter Free - unauthenticated users with Admin access

      Thank you for your reply. That's great news, I'm really looking forward to the new version.

      posted in Support
      V
      vaclav.nadrasky_0945
    • Otter Free - unauthenticated users with Admin access

      Hello!
      Based on Otter licence documentation there should be the same behavior for unauthenticated users in Otter Free as is in the BuildMaster Free - i.e. "View-only" access. In BuildMaster there was a button at Users & Tasks page (/administration/security/tasks) that switched unauthenticated users from "Full-access" to "View-only" access. But there is no such button in Otter. Is there some hidden configuration option for that?

      posted in Support
      V
      vaclav.nadrasky_0945
    • 1 / 1