Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Job definitions in YAML

#172

Job definitions should be defined in YAML (rather than XML). It is better for human readability.

Here is a hypothetical job definition that shows a strawman example:

#
# Job: simpleapp/Deploy
name: Deploy
group: simpleapp
description: deploy the simple app
loglevel: INFO
project: examples
options: 
       catalinahome:
         {description: the tomcat install directory,
         enforcedvalues: false,  required: true, 
         value: /var/rundeck/simpleapp/apache-tomcat}
sequence:
 - exec: step1.sh
 - script: !!str |
       #!/bin/bash
       USAGE="$0 <catalinahome>"
       die() { echo "ERROR: $@" ; exit 1 ; }
       [ $# = 1 ] || { die "Usage: $0 <catalinahome>" ; }
       export CATALINA_HOME=$1
       [ -d "$CATALINA_HOME" ] || { die "CATALINA_HOME not found: $CATALINA_HOME" ; }
       export CATALINA_BASE=$CATALINA_HOME;
       echo "Invoking $CATALINA_HOME/bin/startup.sh"
       $CATALINA_HOME/bin/startup.sh;
       exit $? 
   scriptargs: ${option.catalinahome}
 - jobref: {group: simpleapp,  name: step3,  arg: {line: "-paramA valA -paramB ${option.catalinahome"}}
schedule:
  time: {hour: "06,07,08", minute: 00}
  weekday: {day: "*"}
  month: {month: "*"}
nodefilters:
  include: {tags: simpleapp}
  dispatch: {threadcount: 1,  keepgoing: false}
notification:
  onfailure: {recipients: test@foo.com}
  onsuccess: {recipients: test@foo.com}

Reported by Alex-SF · January 14th, 2011 @ 12:03 PM

State: resolved
Milestone: Rundeck 1.2
Assigned to: Greg Schueler Greg Schueler

Activity

  1. Greg Schueler
    Greg Schueler
    • State changed from new to open
    • Assigned user set to Greg Schueler

    January 21st, 2011 @ 04:16 PM

  2. Greg Schueler
    Greg Schueler

    Three comments about this format:

    First, schedule: weekday: {day: '*'} is pretty verbose. schedule: weekday: '*' seems cleaner. Similar for month.

    Additionally, users can specify either day-of-week OR day-of-month (crontab), so a day-of-month indicator is needed.

    possibly: "weekday" and "day" (for day-of-month)

    schedule: 
      time: ...
      month: ...
      weekday: '1-5'
    

    and

    schedule: 
      time: ...
      month: ...
      day: '1,23'
    

    Second point: Workflows have additional properties (keepgoing, strategy), so a simple sequence: [list] isn't enough.

    We could do:

    sequence:
      keepgoing: true
      strategy: node-first
      commands: 
      - exec: ...
      - script: ...
    

    or change the key names a bit, replace sequence with workflow, and commands with sequence:

    workflow:
      keepgoing: true
      strategy: node-first
      sequence: 
      - exec: ...
      - script: ...
    

    Third item: All the workflow items allow some kind of argument string, but they are named inconsistently. "scriptargs" for the exec/script items, and then arg: line: for the jobref.

    Suggest we change them all to be just "args" or "arguments" or something.

    FYI: here is a first-pass at the yaml output for a job: https://gist.github.com/790772

    January 21st, 2011 @ 05:55 PM

  3. Deleted User
    Deleted User

    Yes for second and third item.

    For first item: can you just use crontab: "* * * * *" so I can cut and paste my crontab time info into a job definition?

    January 21st, 2011 @ 07:38 PM

  4. Deleted User
  5. Greg Schueler
    Greg Schueler

    Notes on format:

    for schedule:

    schedule: 
      time: ...
      month: ...
      weekday: 
        day: '1-4'
    

    or

    schedule: 
      time: ...
      month: ...
      dayofmonth: 
        day: '1-5'
    

    crontab is supported:

    schedule: 
      crontab: * * * * * *
    

    For workflows the format is:

    sequence:
      keepgoing: true
      strategy: node-first
      commands: 
      - exec: ...
        args: ...
      - script: ...
        args: ...
      - scriptfile: ...
        args:
      - jobref:
          name: jobname
          group: group
          args: args
    

    For node dispatch parameters:

       nodefilters:
         dispatch:
           threadcount: 1
           keepgoing: true
           excludePrecedence: true
         include:
           tags: ...
         exclude:
           tags: ...
    

    January 26th, 2011 @ 05:58 PM

  6. Deleted User
  7. Deleted User
  8. Greg Schueler
    Greg Schueler

    Note, for "exec" workflow items there is no support for "args", that was a mistake.

      - exec: ...
    

    January 28th, 2011 @ 05:25 PM

  9. Deleted User
  10. Deleted User
  11. Greg Schueler
    Greg Schueler
    • State changed from open to resolved

    February 25th, 2011 @ 11:14 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.