Skip to content

Instantly share code, notes, and snippets.

@liamjbennett
Created December 23, 2014 12:45
Show Gist options
  • Save liamjbennett/741c9139a66198dc38b2 to your computer and use it in GitHub Desktop.
Save liamjbennett/741c9139a66198dc38b2 to your computer and use it in GitHub Desktop.
Rundeck jobs examples
rundeck_job { 'another_job':
project => 'Test',
description => 'fubar',
group => 'any group',
commands => [
{ 'exec' => 'hostname' },
{ 'script' => "whatever this script is\non multi-lines\nblah",
'description' => 'script description',
'scriptargs' => 'argument1'
},
{ 'scriptfile' => '/var/lib/ramdomfile',
'description' => 'script description',
'scriptargs' => 'argument2'
},
{
'jobref' => {
'arg' => {
'_line' => 'argument1'
},
'_name' => 'any_job',
'_group' => 'any group',
'_nodeStep' => 'true'
},
'description' => 'some description'
},
{
'node-step-plugin' => {
'_type' => 'copyfile',
'configuration' => [
{ 'entry' => { '_key' => 'destinationPath', '_value' => '/var/lib/destfile' } },
{ 'entry' => { '_key' => 'echo', '_value' => 'true' } },
{ 'entry' => { '_key' => 'sourcePath', '_value' => '/var/lib/sourcefile' } }
],
'description' => 'copy file description'
}
},
{
'node-step-plugin' => {
'_type' => 'localexec',
'configuration' => [
{ 'entry' => { '_key' => 'command', '_value' => 'some command' } },
],
'description' => 'localexec desciption'
}
}
],
node_filter => '.*',
node_precedence => 'exclude',
threads => '1',
rank_attribute => 'osfamily',
rank_order => 'ascending',
keep_going => 'false',
notifications => {
'onsuccess' => {
'email' => {
'_recipients' => 'lbennett@opentable.com',
'_attachLog' => 'true'
},
'webhook' => {
'_urls' => 'http://localhost:8080'
},
'pager_duty' => {
'_subject' => '${job.status} [${job.project}] "${job.name}" run by ${job.user} (#${job.execid})'
},
'jira' => {
'_issuekey' => 'FUBAR'
},
'hipchat' => {
'_room' => 'TestRoom'
}
}
},
job_schedule => {
'time' => {
'_seconds' => '0',
'_minute' => '00',
'_hour' => '00'
},
'weekday' => '*',
'month' => '*',
'year' => '*'
},
multiple_exec => 'true',
timeout => '3d',
retry => '5',
options => [
{
'_name' => 'option_one',
'_value' => 'option_one',
'_values' => 'option_one',
'_required' => 'true',
'_multivalued' => 'true',
'_delimiter' => ',',
'description' => 'option description'
},
{
'_name' => 'option_two',
'_value' => 'option_two',
'_valuesUrl' => 'http://localhost:8081',
'_enforcedvalues' => 'true',
'_delimiter' => ',',
'description' => 'option description'
},
{
'_name' => 'option_three',
'_value' => 'option_three',
'_values' => 'option_three',
'_regex' => '.*',
'_delimiter' => ',',
'description' => 'option description'
},
{
'_name' => 'option_four',
'_value' => 'option_four',
'_values' => 'option_four',
'_secure' => 'true',
'_valueExposed' => 'true',
'description' => 'option description'
},
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment