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!

    Restart-Server does not execute

    Scheduled Pinned Locked Moved Support
    serversinstallotter
    6 Posts 1 Posters 36 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 need the ability to execute Restart-Server when executing Server Configuration plans. I am installing a series of heavy-weight installers (VS2017, SQL Server etc.) Often these installers either require the server is rebooted before starting the install, or after the install. I check for the server's reboot status before installing each package. If a reboot is required, then I would like to reboot. I am finding that the Restart-Server operation is not executed in configuration plans. It does work from Orchestration plans as expected.

      Is there a recommended way to accomplish what I need to do?

      Product: Otter
      Version: 1.5.5

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

        The Restart-Server operation is a Execute operation, which means it will only execute in a block where drift is detected.

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

          Thanks Alana, that is what I arrived at as well. Is there a way to execute a block of OtterScript during execution when drift is detetected. Basically what I would like to do is:

          1. If drifted is detected during collection phase:
               a. During Configuration phase
                     1. Call OtterScript template (to disable TeamCity agent)
                     2. Call OtterScript template to reboot if required
                     3. Call OtterScript template to install chocolatey package
                     4. Call OtterScript template (to enable TeamCity agent)
          
          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            To do this, use the Execution Directive statement and set the Execution Policy to Always.

            with executionPolicy=always 
            {
               ...
            }
            

            That block will behave as if drift occurred within it.

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

              Thanks Alex! I think I was told that before, but forgot about it. For future reference, is this in the Otter documentation?

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

                It is, albeit a bit buried in the formal specification.

                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