Job definitions in YAML
Reported by Alex-SF | 2011-01-14 12:03:37 UTC | in Rundeck 1.2
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}
Comments and changes to this ticket
-

Greg Schueler 2011-01-21 16:16:16 UTC
- State changed from new to open
- Assigned user set to Greg Schueler
-

Greg Schueler 2011-01-21 17:55:58 UTC
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
-

Deleted User 2011-01-21 19:38:08 UTC
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? -

Deleted User 2011-01-26 17:42:28 UTC
(from [1a74fb3af36794bc58b85f3d2146d2eb287372c6]) Initial jobs yaml format support [#172] https://github.com/dtolabs/rundeck/commit/1a74fb3af36794bc58b85f3d2...
-

Greg Schueler 2011-01-26 17:58:37 UTC
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: argsFor node dispatch parameters:
nodefilters: dispatch: threadcount: 1 keepgoing: true excludePrecedence: true include: tags: ... exclude: tags: ... -

Deleted User 2011-01-27 11:15:14 UTC
(from [9287281332a2f9532f92127041bf5c51ad3b7a5a]) Force multiline scalars to literal style. [#172] https://github.com/dtolabs/rundeck/commit/9287281332a2f9532f9212704...
-

Deleted User 2011-01-28 17:14:55 UTC
(from [2ff2df98b855d4502c16f3ed709d9c6b9cb666e5]) Fix some domain properties, update yaml tests [#172] https://github.com/dtolabs/rundeck/commit/2ff2df98b855d4502c16f3ed7...
-

Greg Schueler 2011-01-28 17:25:09 UTC
Note, for "exec" workflow items there is no support for "args", that was a mistake.
- exec: ... -

-

Deleted User 2011-02-25 10:09:24 UTC
- Milestone order changed from 14 to 0
(from [c1c60e4118233b4e48698b728d6f2284b3501d0e]) Update job definition download toolbar to allow format selection [#172] https://github.com/dtolabs/rundeck/commit/c1c60e4118233b4e48698b728...
-

Greg Schueler 2011-02-25 11:14:32 UTC
- State changed from open to resolved
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
(DEPRECATED) Please use github issues for issue tracking at http://github.com/dtolabs/rundeck/issues
People watching this ticket
Referenced by
-
172
Job definitions in YAML
(from [1a74fb3af36794bc58b85f3d2146d2eb287372c6])
Initial...
-
172
Job definitions in YAML
(from [9287281332a2f9532f92127041bf5c51ad3b7a5a])
Force m...
-
172
Job definitions in YAML
(from [2ff2df98b855d4502c16f3ed709d9c6b9cb666e5])
Fix som...
-
187
Document jobs/resources yaml formats
The job/resources YAML formats need documentation. ref: #...
-
172
Job definitions in YAML
(from [f760e60136f62ad0e6287ed5c3c02730731c3c4b])
Fix mul...
-
172
Job definitions in YAML
(from [c1c60e4118233b4e48698b728d6f2284b3501d0e])
Update ...