0

I am migrating a client from Control-M to a more modern solution. Client is running workloads in AWS, and has been considering using Rundeck to replace Control-M.

The control-m jobs run sequentially (one after another) only when the previous jobs terminates successfully.

A few of the jobs run in parallel (1 or more of the parallel jobs do not have dependent "child" jobs), but almost all run sequentially.

Does rundeck support running jobs sequentially? How can this be achieved?

Edit 1: client has over 500 jobs, with one command (shell) each. Target node is ec2 instance in same VPC with ssh public key authn configured.

Felipe Alvarez
  • 3,720
  • 2
  • 33
  • 42

1 Answers1

0

You can set the Strategy of your Job, for that Create or Edit your job and go to Workflow tab > Strategy = Sequential, check this.

You have a complete explanation of strategies here and here.

EDIT 2: I leave an example focused on jobs using Job Reference Step.

Job A

    <joblist>
      <job>
        <defaultTab>nodes</defaultTab>
        <description></description>
        <executionEnabled>true</executionEnabled>
        <id>7e85b6ff-4813-4f94-85f2-2b91ff359fd4</id>
        <loglevel>INFO</loglevel>
        <name>JobA</name>
        <nodeFilterEditable>false</nodeFilterEditable>
        <scheduleEnabled>true</scheduleEnabled>
        <sequence keepgoing='false' strategy='node-first'>
          <command>
            <exec>sleep 2; echo "i am the job a"</exec>
          </command>
        </sequence>
        <uuid>7e85b6ff-4813-4f94-85f2-2b91ff359fd4</uuid>
      </job>
    </joblist>

Job B

    <joblist>
      <job>
        <defaultTab>nodes</defaultTab>
        <description></description>
        <executionEnabled>true</executionEnabled>
        <id>859788d6-1fef-4467-8ce9-bc34ef6735e2</id>
        <loglevel>INFO</loglevel>
        <name>JobB</name>
        <nodeFilterEditable>false</nodeFilterEditable>
        <scheduleEnabled>true</scheduleEnabled>
        <sequence keepgoing='false' strategy='node-first'>
          <command>
            <exec>sleep 2; echo "i am the job b"</exec>
          </command>
        </sequence>
        <uuid>859788d6-1fef-4467-8ce9-bc34ef6735e2</uuid>
      </job>
    </joblist>

Job C

    <joblist>
      <job>
        <defaultTab>nodes</defaultTab>
        <description></description>
        <executionEnabled>true</executionEnabled>
        <id>458d13d1-7436-4d7e-b7a2-382a5bea449f</id>
        <loglevel>INFO</loglevel>
        <name>JobC</name>
        <nodeFilterEditable>false</nodeFilterEditable>
        <scheduleEnabled>true</scheduleEnabled>
        <sequence keepgoing='false' strategy='node-first'>
          <command>
            <exec>sleep 2; echo "i am the job c"</exec>
          </command>
        </sequence>
        <uuid>458d13d1-7436-4d7e-b7a2-382a5bea449f</uuid>
      </job>
    </joblist>

The parent job with Job Reference Step:

    <joblist>
      <job>
        <defaultTab>nodes</defaultTab>
        <description></description>
        <executionEnabled>true</executionEnabled>
        <id>af4b4937-f4c2-4d73-ba8e-0ccc50bc6479</id>
        <loglevel>INFO</loglevel>
        <name>ParentJob</name>
        <nodeFilterEditable>false</nodeFilterEditable>
        <scheduleEnabled>true</scheduleEnabled>
        <sequence keepgoing='false' strategy='sequential'>
          <command>
            <jobref name='JobA' nodeStep='true'>
              <uuid>7e85b6ff-4813-4f94-85f2-2b91ff359fd4</uuid>
            </jobref>
          </command>
          <command>
            <jobref name='JobB' nodeStep='true'>
              <uuid>859788d6-1fef-4467-8ce9-bc34ef6735e2</uuid>
            </jobref>
          </command>
          <command>
            <jobref name='JobC' nodeStep='true'>
              <uuid>458d13d1-7436-4d7e-b7a2-382a5bea449f</uuid>
            </jobref>
          </command>
        </sequence>
        <uuid>af4b4937-f4c2-4d73-ba8e-0ccc50bc6479</uuid>
      </job>
    </joblist>

For example, if any job fails, the execution stops. With Rundeck 3.2.0 Enterprise, you can use the Job Resume feature to retake the execution at the failed step (only for sequential strategy).

MegaDrive68k
  • 3,768
  • 2
  • 9
  • 51
  • I only have 1 node. Will setting the Strategy = Sequential cause jobs to run only when previous jobs terminate successfully? How does one create a dependency map of the jobs? `A-->B-->C-->N` – Felipe Alvarez Dec 20 '19 at 04:08
  • Yes, I updated my answer with an example and the "job resume" feature (for Rundeck 3.2 Enterprise). – MegaDrive68k Dec 20 '19 at 12:24
  • 1
    Is this showing _**commands**_ being run sequentially, or _**jobs**_? I need jobs to be run sequentially. Each job has one command. – Felipe Alvarez Dec 23 '19 at 00:14
  • 1
    You're right! For that you can use the Job Reference Step as steps in a parent Job referencing your jobs sequentially, my example is updated. – MegaDrive68k Dec 23 '19 at 12:21