rundeck-plugins / rundeck-ec2-nodes-plugin

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

Add support for http proxy #14

Closed ghost closed 9 years ago

ghost commented 10 years ago

Configuring rundeck JVM with proxy settings doesn't enable EC2 communication thru proxy.

https://groups.google.com/d/msg/rundeck-discuss/Ty0vCBhlHEw/F70e4_qsJ_EJ

patelgaurang83 commented 10 years ago

Any update on prioritizing this issue? I hit the same situation so wondering if this can be addressed soon.

patelgaurang83 commented 10 years ago

A pull request to fix this issue in pending https://github.com/rundeck-plugins/rundeck-ec2-nodes-plugin/pull/16. Until then just clone "https://github.com/patelgaurang83/rundeck-ec2-nodes-plugin", run "gradlew" on unix and deploy ec2-plugin jar from "build/libs/" folder.

ghost commented 10 years ago

Greg, any update on this? I also forgot to mention that support for proxy authentication would be a huge plus.

Gaurang, does your fork support proxy user/pass?

gschueler commented 10 years ago

hi, it is in my backlog of things to get to (merge that pull request). If others can confirm that it works as expected, that would be helpful

patelgaurang83 commented 10 years ago

Hi Baron,

No. It doesn't support username/password as of now.

ghost commented 10 years ago

A colleague of mine downloaded @patelgaurang83's fork and add the proxy user and password properties that the AWS SDK supports and that is working at our organization.

EC2ResourceModelSourceFactory.java
66a67,68
>     public static final String HTTP_PROXY_USER = "httpProxyUser";
>     public static final String HTTP_PROXY_PASS = "httpProxyPass";
90a93,94
>             .property(PropertyUtil.string(HTTP_PROXY_USER, "HTTP Proxy User", "HTTP Proxy User Name, or blank for default", false, null))
>             .property(PropertyUtil.string(HTTP_PROXY_PASS, "HTTP Proxy Password", "HTTP Proxy Password, or blank for default", false, null))

EC2ResourceModelSource.java
60a61,62
>     String httpProxyUser;
>     String httpProxyPass;
140a143,144
>         this.httpProxyUser= configuration.getProperty(EC2ResourceModelSourceFactory.HTTP_PROXY_USER);
>         this.httpProxyPass = configuration.getProperty(EC2ResourceModelSourceFactory.HTTP_PROXY_PASS);
171a176,177
>             clientConfiguration.setProxyUsername(httpProxyUser);
>             clientConfiguration.setProxyPassword(httpProxyPass);
gschueler commented 9 years ago

thanks for the patch @BaronVonJ

I've merged the pull request and add that patch. I will issue a new release shortly

russellballestrini commented 9 years ago

+1 for adding this

jbecker42 commented 9 years ago

Nevermind! I found the settings in the Resource config.

Thanks Greg for adding this. I add the options to /etc/rundeck/profile as follows (with rundeck restart), but I don't see the traffic going to the proxy server. Is there something I'm missing on setting the proxy config?

export RDECK_JVM="-Djava.security.auth.login.config=/etc/rundeck/jaas-loginmodule.conf \ -Dhttps.proxyHost=some-name.elb.amazonaws.com \ -Dhttps.proxyPort=3128 \ -Dhttp.proxyHost=some-name.elb.amazonaws.com \ -Dhttp.proxyPort=3128 \ ...

gschueler commented 9 years ago

@jbecker42 i see, it might be a good enhancement to automatically configure the proxy settings from java system props if they are present.. maybe file as a new enhancement request?