Search code examples
amazon-web-servicesamazon-ec2rundeck

How to use node specific SSH keys with Rundeck AWS EC2 Resource Plugin?


I have configured a Rundeck server with AWS EC2 Resource Plugin for the nodes.

Now for multiple EC2 instances i am using different SSH keys.

Is there any way to tell Rundeck to use different SSH keys for different EC2 instance(Rundeck Nodes) in same Rundeck Project?

I have tried using AWS Resource Plugin mapping to specify "ssh-keypath" for Rundeck , but found no luck.Is there any alternative for that?


Solution

  • You should be able to use ssh-keypath to point to a local file, or ssh-key-storage-path to point to a location in the Key Storage facility. You can also include things like ${node.instanceId} in the path(s) to dynamically specify the value. For the EC2 provider, you would set that in the "mapping" configuration, as something like ssh-key-storage-path.default=keys/nodes/node-${node.instanceId}.sshkey

    If you only specified a static value for the keypath, that same value would be used for all nodes. Is that what you tried?

    The alternative is to set the default value in the SSH Node Executor configuration within the Project configuration, again using a dynamic node variable in the keypath. You can do that in the Project Configuration GUI (or the project.properties file contents). If you do that, do not set a value in the EC2 provider which will override the project default.