I’m trying to setup a step in which I need to scp some files from a remote host to my node running the job.
This remote node has to be defined using a TAG, but I can’t find how to do that.
For now, the step looks like this :
bash -c "scp -r rundeck@${option.SOURCE_SERVER}:/srv/tmp/backup/FileStore.$(date +"%Y%m%d.tar.gz" ) rundeck@${node.hostname}:/srv/tmp/"
But this means the SOURCE_SERVER has to be defined at usage (or using default value), but I would like to use an existing tag to define it, so that it dynamic : is that possible ?
The best way to do that is to use the File Transfer Plugin (only for Runbook Automation and Runbook Automation Self-hosted, formerly “Rundeck Enterprise”).
Now, to do so in the OSS version. If you want to copy files from remote nodes to the rundeck instance, use the node.hostname
to the origin server, and always point to the rundeck instance to the remote server which always would be the same hostname (via scp
) like this.
If you want to copy files between remote nodes, maybe the best approach is to create a JSON remote option (stored in your Rundeck instance filesystem) with all node names synced with your model source and use this to select the option value from a list.