Using shell I/O for communicating with Rundeck from script

238 views
Skip to first unread message

Espen Blikstad

unread,
May 19, 2017, 4:39:54 AM5/19/17
to rundeck-discuss
Hi

A great idea of communication between Rundeck "job" and the job script would be using shell I/O.

A very simple idea, put an escape character and a "command" on the line.
^VAR=123

Make Rundeck interpret the shell output and for instance set a job option for dynamic options.
More advanced script helpers could use both input and output for bidirectional communication.

I need to look in the code implementation of job options. Having scriptable options creates the possibility of conditional job steps.

Regards,
Espen Blikstad

Greg Schueler

unread,
May 19, 2017, 12:43:03 PM5/19/17
to rundeck-discuss
Hi Espen,

I'm currently working on a solution for this, this falls under the "Data-capture plugin" feature on our Trello board: https://trello.com/c/oU8OjZoH



For the benefit of everyone not interested in reading through commit logs, here's the TL;DR  progress update:

* new Plugins can be used to filter log lines coming from steps, called LogFilterPlugins
* a new shared "data context" can be used to save data values grepped/parsed from those logs
* steps in a workflow can use those data values in the same way as current "context" variables.

For example, I've added a basic "key value capture" filter plugin, so this script

    #!/bin/bash
    echo RUNDECK:DATA:mydata=somevalue

will capture a variable ${data.mydata}, which can be used in subsequent steps.  If you are executing steps on the same node, the `${data.mydata}` comes
from the node same node that echoed it previously.  If you want data from a different node, currently you can do `${data.mydata@nodename}` to
read the value from a separate node.

There's a lot more that these filter plugins can do, for example modifying, adding, or removing log events.

Another example plugin I've created is a "Mask Passwords Filter" plugin.  This uses the known "private"/password data in the execution
context and replaces any values seen in emitted logs with a "*****".  

When will this be ready, you ask? It will be part of the 2.9.0 release, but at this time the ETA is not set.

Any feedback is appreciated.

cheers,
Greg

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To post to this group, send email to rundeck...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/8853a164-5e13-44f7-800d-c4d6b7dba25a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages