rundeck-plugins / rundeck-ec2-nodes-plugin

Get resource node data from Amazon EC2
86 stars 45 forks source link

Unable to get public IP address as hostname #85

Closed dragan1979 closed 6 years ago

dragan1979 commented 6 years ago

i specified this as mapping:

name.selector=tags/Name hostname.selector=publicIpAddress description.default=Ec2 node instance osArch.selector=architecture osFamily.selector=platform osFamily.default=unix osName.selector=platform osName.default=Linux username.selector=tags/Rundeck-User username.default=root editUrl.default=https://console.aws.amazon.com/ec2/home#c=EC2&s=Instances attribute.publicIpAddress.selector=publicIpAddress attribute.publicDnsName.selector=publicDnsName tags.selector=tags/Rundeck-Tags

I'm running CentOS EC2 instance

But, instead of root user i'm getting ec2-user@ec2-34-241-194-76.eu-west-1.compute.amazonaws.com although ec2-user isn't specified anywhere in mapping and ssh connection fails

dragan1979 commented 6 years ago

it became a habit to answer my own questions :) i needed to add semicolumns (;)

name.selector=tags/Name hostname.selector=publicIpAddress,publicIp; description.default=Ec2 node instance; osArch.selector=architecture; osFamily.selector=platform; osFamily.default=unix; osName.selector=platform; osName.default=Linux; username.selector=tags/Rundeck-User; username.default=root; ssh-keypath.default=/path/to/key; editUrl.default=https://console.aws.amazon.com/ec2/home#c=EC2&s=Instances; attribute.publicIpAddress.selector=publicIpAddress; attribute.publicDnsName.selector=publicDnsName; tags.selector=tags/Rundeck-Tags Then, mo matter what ssh-key path i specified, i got connection error from Rundeck, so only way was to copy keys from /root/.ssh/ to /var/lib/rundeck/.ssh

Only after that, i got rid of errors