RD_CONFIG_ variables in plugins?

535 views
Skip to first unread message

Akos Hencz

unread,
Nov 4, 2014, 9:06:18 AM11/4/14
to rundeck...@googlegroups.com
Hello,

I am working on a plugin, and added a few plugin properties as per the documentation: http://rundeck.org/docs/developer/plugin-development.html#plugin-properties
The properties are visible in the project configuration, where I can assign them values.

The problem is that the RD_CONFIG_PROPERTY_NAME variables are not available to the script. I did a 'printenv' from the plugin and saw many RD_ variables, but no RD_CONFIG_ variables.
I also tried to use ${config.property_name} at the list of script arguments, but that doesn't seem to work either. Looking at the project configuration I see the proper values assigned to the plugin's properties.

Any ideas?

Cheers,
Akos

Akos Hencz

unread,
Nov 5, 2014, 8:45:11 AM11/5/14
to rundeck...@googlegroups.com
Just to be less cryptic I shared the code: https://github.com/cernops/rundeck-exec-kerberos/tree/devel/ssh-krb-node-executor-plugin

When I try to use the plugin, I get an error message that indicates that the $RD_CONFIG_* variables are empty. When I print the available environmental variables from the plugin I get the following list:

RD_PLUGIN_BASE
RD_NODE_OS_FAMILY
RD_NODE_DESCRIPTION
RD_NODE_USERNAME
RD_JOB_WASRETRY
RD_PLUGIN_FILE
RD_JOB_NAME
RD_PLUGIN_SCRIPTFILE
RD_JOB_USER_NAME
RD_JOB_USERNAME
RD_FILE_COPY_FILE
RD_JOB_PROJECT
RD_NODE_NAME
RD_JOB_EXECID
RD_PLUGIN_VARDIR
RD_JOB_URL
PWD
RD_RUNDECK_BASE
RD_NODE_OS_NAME
RD_FILE_COPY_DESTINATION
SHLVL
RD_JOB_LOGLEVEL
RD_JOB_ID
RD_NODE_HOSTNAME
RD_OPTION_MYOPTION
RD_RUNDECK_PROJECT
RD_NODE_OS_ARCH
RD_JOB_SERVERURL
RD_NODE_TAGS
RD_JOB_RETRYATTEMPT
RD_PLUGIN_TMPDIR
RD_NODE_OS_VERSION

Greg Schueler

unread,
Nov 5, 2014, 1:13:04 PM11/5/14
to Akos Hencz, rundeck...@googlegroups.com
Hi Akos,

What rundeck version are you using?  Rundeck 2.2 and earlier did not support custom config properties in script-based node executor plugins.  2.3.0 should support this.  What does your project.properties look like after you save the configuration?


--
Greg Schueler
--
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.
For more options, visit https://groups.google.com/d/optout.

Akos Hencz

unread,
Nov 6, 2014, 5:00:18 AM11/6/14
to rundeck...@googlegroups.com, akos....@gmail.com
Hello Greg,

I forgot to mention the version, it's 2.3.1.

The project properties:
#Project PuppetDB.tasks configuration, generated
#Wed Nov 05 15:18:26 CET 2014
project
.plugin.FileCopier.scp-krb.kerberos_keytab=/var/lib/rundeck/var/airund.keytab
resources
.source.1.config.generateFileAutomatically=true
project
.ssh-authentication=privateKey
service
.FileCopier.default.provider=scp-krb
project
.plugin.NodeExecutor.ssh-krb.kerberoskeytab=/var/lib/rundeck/var/airund.keytab
project
.ssh-keypath=/var/lib/rundeck/.ssh/id_rsa
resources
.source.2.config.interpreter=/usr/bin/ruby
resources
.source.1.config.includeServerNode=true
project
.plugin.FileCopier.scp-krb.kerberoskeytab=/var/lib/rundeck/var/airund.keytab
project
.plugin.NodeExecutor.ssh-krb.kerberos_keytab='/var/lib/rundeck/var/airund.keytab'
resources
.source.1.config.format=resourcexml
resources
.source.2.config.argsQuoted=false
service
.NodeExecutor.default.provider=ssh-krb
resources
.source.1.config.requireFileExists=false
resources
.source.2.config.format=resourceyaml
resources
.source.2.config.file=/var/lib/rundeck/var/scripts/foreman_nodes.rb
project
.name=PuppetDB.tasks
project
.plugin.FileCopier.scp-krb.kerberosuser=airund
project
.plugin.NodeExecutor.ssh-krb.kerberos_user='airund'
plugin
.script-exec.default.command=/var/lib/rundeck/var/scripts/krb_ssh_executor.sh
resources
.source.1.type=file
project
.plugin.FileCopier.scp-krb.kerberos_user=airund
resources
.source.2.config.args=-e production -h punch/puppetdb
resources
.source.1.config.file=/var/rundeck/projects/PuppetDB.tasks/etc/resources.xml
resources
.source.2.type=script
project
.plugin.NodeExecutor.ssh-krb.kerberosuser=airund


You can find multiple 'verions' of the properties, because I tried it with and without underscore (kerberos_user <> kerberosuser), to see it that's the problem.

Cheers,
Akos

Akos Hencz

unread,
Nov 13, 2014, 8:22:07 AM11/13/14
to rundeck...@googlegroups.com, akos....@gmail.com
Am I missing something? Is there a working example somewhere?

Greg Schueler

unread,
Nov 13, 2014, 1:09:47 PM11/13/14
to Akos Hencz, rundeck...@googlegroups.com, akos....@gmail.com
Hi Akos,

I just tried this out and as you say it is not working.  I've determined it is a bug with FileCopier specifically.  NodeExecutor works, but it is failing to load the config values for the FileCopier if they are set in the project or framework level.  I filed a bug https://github.com/rundeck/rundeck/issues/1018

--
Greg Schueler

Akos Hencz

unread,
Nov 14, 2014, 4:57:53 AM11/14/14
to rundeck...@googlegroups.com, akos....@gmail.com
Thanks Greg! :)
Reply all
Reply to author
Forward
0 new messages