jjblack
jjblack

Reputation: 13

How to make a Rundeck parent job with different nodes for each workflow step?

I have three jobs in the same project with their own node filters. And the matched nodes do not overlap between these jobs. I want to create a parent job that runs these three jobs instead of me running them individually. How do I configure the nodes on this parent job? Each step has it's own list of nodes.

Upvotes: 0

Views: 283

Answers (1)

MegaDrive68k
MegaDrive68k

Reputation: 4325

Nothing is needed in the Parent Job, just edit the Job Reference Steps and click on the "Use referenced job's nodes." checkbox.

A basic example:

Parent Job:

- defaultTab: nodes
  description: ''
  executionEnabled: true
  id: a0d5834d-4b62-44d9-bd1e-f00a6befb990
  loglevel: INFO
  name: ParentJob
  nodeFilterEditable: false
  plugins:
    ExecutionLifecycle: null
  scheduleEnabled: true
  sequence:
    commands:
    - jobref:
        childNodes: true
        group: ''
        name: JobA
        uuid: 63fb953c-53e0-4233-ba28-eabd69a0e41c
    - jobref:
        childNodes: true
        group: ''
        name: JobB
        uuid: 8936db73-9bd4-4912-ae07-c5fc8500ee9d
    - jobref:
        childNodes: true
        group: ''
        name: JobC
        uuid: 16fa66d3-fbda-439a-9a2b-14f90e99f72b
    keepgoing: false
    strategy: node-first
  uuid: a0d5834d-4b62-44d9-bd1e-f00a6befb990

JobA:

- defaultTab: nodes
  description: ''
  executionEnabled: true
  id: 63fb953c-53e0-4233-ba28-eabd69a0e41c
  loglevel: INFO
  name: JobA
  nodeFilterEditable: false
  nodefilters:
    dispatch:
      excludePrecedence: true
      keepgoing: false
      rankOrder: ascending
      successOnEmptyNodeFilter: false
      threadcount: '1'
    filter: 'name: node00 '
  nodesSelectedByDefault: true
  plugins:
    ExecutionLifecycle: null
  scheduleEnabled: true
  sequence:
    commands:
    - exec: hostname
    keepgoing: false
    strategy: node-first
  uuid: 63fb953c-53e0-4233-ba28-eabd69a0e41c

JobB:

- defaultTab: nodes
  description: ''
  executionEnabled: true
  id: 8936db73-9bd4-4912-ae07-c5fc8500ee9d
  loglevel: INFO
  name: JobB
  nodeFilterEditable: false
  nodefilters:
    dispatch:
      excludePrecedence: true
      keepgoing: false
      rankOrder: ascending
      successOnEmptyNodeFilter: false
      threadcount: '1'
    filter: 'name: node01'
  nodesSelectedByDefault: true
  plugins:
    ExecutionLifecycle: null
  scheduleEnabled: true
  sequence:
    commands:
    - exec: hostname
    keepgoing: false
    strategy: node-first
  uuid: 8936db73-9bd4-4912-ae07-c5fc8500ee9d

JobC:

- defaultTab: nodes
  description: ''
  executionEnabled: true
  id: 16fa66d3-fbda-439a-9a2b-14f90e99f72b
  loglevel: INFO
  name: JobC
  nodeFilterEditable: false
  nodefilters:
    dispatch:
      excludePrecedence: true
      keepgoing: false
      rankOrder: ascending
      successOnEmptyNodeFilter: false
      threadcount: '1'
    filter: 'name: node02'
  nodesSelectedByDefault: true
  plugins:
    ExecutionLifecycle: null
  scheduleEnabled: true
  sequence:
    commands:
    - exec: hostname
    keepgoing: false
    strategy: node-first
  uuid: 16fa66d3-fbda-439a-9a2b-14f90e99f72b

Check the Result.

Upvotes: 0

Related Questions