-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not get nodes from ansible hosts #3
Comments
I haven't tested with Ansible < v2, seems like there are some differences. Please try the latest release! |
nice work! it seems to have fixed the issue now. Thanks! |
Good to hear! Feel free to close this issue once you confirmed this error is gone. |
I am running into the same issue. In this case, I am running Ansible within an EC2 instance, using IAM roles. Ansible is able to do inventory from AWS via the cli. The config as follows: rundeck@rundeck:~$ cat .ansible.cfg
The ec2.py is in the /etc/ansible/inventory directory. |
@rilindo have you tried v1.0.1? |
@frozenice I am running 1.0.1:
|
@rilindo is there any stacktrace or error message? Can your Rundeck user run Ansible? Try with something like |
Looking at the service.log, I see this: https://gist.github.com/rilindo/8b2670ee4bbac07021c8 rundeck.log says: https://gist.github.com/rilindo/6626a143186d9313d89a Running with su command gives me:
But that is to be expected, as the rundeck user is running under the root environment, which does not have the ansible configured. To run the above above command with the rundeck env (which has the Ansible ENV setup, you have to run:
So does that mean the plugin runs as the root user or the rundeck user? Before you ask, yes, the service is running as the rundeck user:
|
Well, Ansible is run as a new process under whatever environment Rundeck runs, see here. You mentioned you need to use a login shell (the single Another thing I noticed from your first stacktrace ( |
That was it. I was using the stock rundeck user init file, so I thought that it is okay. Once I added the login shell, it was able to pull the nodes. There are other issues, but I'll just open a new issue. Thanks! |
Awesome! :) Closing this one. |
@rilindo I face the same issue you had. Could you please explain more on below statement ? Which file I have to update and what is it? Thank you very much.
|
My environment:
My ansible hosts file:
I create a project followed your instructions, but can not get nodes from ansible hosts with this error:
2016-03-17 00:02:30,933 [qtp10900158-29] ERROR com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource - [ResourceMo delSource: 1.com.batix.rundeck.AnsibleResourceModelSourceFactory (Ansible Resource Model Source), project: test-project] java.lang.UnsupportedOperationException: JsonObject at com.google.gson.JsonElement.getAsString(JsonElement.java:191) at com.batix.rundeck.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:206) at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:45) at com.dtolabs.rundeck.core.common.ProjectNodeSupport.getNodeSet(ProjectNodeSupport.java:88) at com.dtolabs.rundeck.core.common.IProjectNodes$getNodeSet.call(Unknown Source) at rundeck.services.nodes.CachedProjectNodes.reloadNodeSet(CachedProjectNodes.groovy:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1207) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1074) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
Then, I turn off the option "Gather Facts", but still can't get nodes. The error is:
2016-03-17 00:26:36,951 [qtp10900158-31] ERROR com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource - [ResourceModelSource: 1.com.batix.rundeck.AnsibleResourceModelSourceFactory (Ansible Resource Model Source), project: test-project] java.lang.NullPointerException at com.batix.rundeck.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:206) at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:45) at com.dtolabs.rundeck.core.common.ProjectNodeSupport.getNodeSet(ProjectNodeSupport.java:88) at com.dtolabs.rundeck.core.common.IProjectNodes$getNodeSet.call(Unknown Source) at rundeck.services.nodes.CachedProjectNodes.reloadNodeSet(CachedProjectNodes.groovy:24) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
The text was updated successfully, but these errors were encountered: