ansible-plugin: No nodes are displayed if any are unreachable

If any of my hosts are unreachable the plugin seems to dislike the non-zero exit code returned by Ansible and won’t show any hosts in the nodes section. If I change my hosts file so only the online hosts are in inventory, it works as expected.

PLAY RECAP *********************************************************************
SERVER-01 : ok=3    changed=2    unreachable=0    failed=0
SERVER-02 : ok=2    changed=1    unreachable=0    failed=0
SERVER-03 : ok=0    changed=0    unreachable=1    failed=0
SERVER-04 : ok=0    changed=0    unreachable=1    failed=0
SERVER-05 : ok=0    changed=0    unreachable=1    failed=0
SERVER-06 : ok=2    changed=1    unreachable=0    failed=0
SERVER-07 : ok=0    changed=0    unreachable=1    failed=0
SERVER-08 : ok=2    changed=1    unreachable=0    failed=0
SERVER-09 : ok=2    changed=1    unreachable=0    failed=0
SERVER-10 : ok=0    changed=0    unreachable=1    failed=0
SERVER-11 : ok=0    changed=0    unreachable=1    failed=0
SERVER-12 : ok=0    changed=0    unreachable=1    failed=0
SERVER-13 : ok=0    changed=0    unreachable=1    failed=0
SERVER-14 : ok=0    changed=0    unreachable=1    failed=0
SERVER-15 : ok=0    changed=0    unreachable=1    failed=0
SERVER-16 : ok=0    changed=0    unreachable=1    failed=0
SERVER-17 : ok=2    changed=1    unreachable=0    failed=0
SERVER-18 : ok=2    changed=1    unreachable=0    failed=0
SERVER-19 : ok=2    changed=1    unreachable=0    failed=0
SERVER-20 : ok=2    changed=1    unreachable=0    failed=0
SERVER-21 : ok=2    changed=1    unreachable=0    failed=0
SERVER-22 : ok=0    changed=0    unreachable=1    failed=0
SERVER-23 : ok=0    changed=0    unreachable=1    failed=0
SERVER-24 : ok=0    changed=0    unreachable=1    failed=0
SERVER-25 : ok=2    changed=1    unreachable=0    failed=0
SERVER-26 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-19 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-20 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-21 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-22 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-23 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-24 : ok=0    changed=0    unreachable=1    failed=0
DATABASE-25 : ok=0    changed=0    unreachable=1    failed=0

ERROR ExceptionCatchingResourceModelSource: [ResourceModelSource: 2.source (Ansible Resource Model Source), project: Ansible-test]
com.dtolabs.rundeck.core.resources.ResourceModelSourceException: Error running playbook.
        at com.batix.rundeck.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:72)
        at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:57)
        at com.dtolabs.rundeck.core.common.ProjectNodeSupport.getNodeSet(ProjectNodeSupport.java:92)
        at com.dtolabs.rundeck.core.common.ProjectNodeSupport$ProjectNodesSource.getNodes(ProjectNodeSupport.java:292)
        at com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource.getNodes(ExceptionCatchingResourceModelSource.java:57)
        at com.dtolabs.rundeck.core.resources.ResourceModelSource$getNodes.call(Unknown Source)
        at rundeck.services.nodes.CachedProjectNodes.reloadNodeSet(CachedProjectNodes.groovy:26)
        at rundeck.services.nodes.CachedProjectNodes$reloadNodeSet.call(Unknown Source)
        at rundeck.services.NodeService$_loadNodes_closure3.doCall(NodeService.groovy:232)
        at rundeck.services.NodeService$_loadNodes_closure3.doCall(NodeService.groovy)
        at sun.reflect.GeneratedMethodAccessor820.invoke(Unknown Source)
        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:1016)
        at groovy.lang.Closure.call(Closure.java:423)
        at groovy.lang.Closure.call(Closure.java:417)
        at com.codahale.metrics.Timer.time(Timer.java:99)
        at com.codahale.metrics.Timer$time.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at com.codahale.metrics.Timer$time.call(Unknown Source)
        at MetricswebGrailsPlugin$_addDynamicMetricMethods_closure26.doCall(MetricswebGrailsPlugin.groovy:174)
        at sun.reflect.GeneratedMethodAccessor516.invoke(Unknown Source)
        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:1016)
        at groovy.lang.Closure.call(Closure.java:423)
        at org.codehaus.groovy.runtime.metaclass.ClosureStaticMetaMethod.invoke(ClosureStaticMetaMethod.java:59)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoMetaMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:230)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:68)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:96)
        at rundeck.services.NodeService.loadNodes(NodeService.groovy:244)
        at sun.reflect.GeneratedMethodAccessor813.invoke(Unknown Source)
        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 org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:80)
        at rundeck.services.NodeService.this$dist$invoke$1(NodeService.groovy)
        at rundeck.services.NodeService$2.methodMissing(NodeService.groovy)
        at sun.reflect.GeneratedMethodAccessor741.invoke(Unknown Source)
        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.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:933)
        at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1256)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1209)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:807)
        at rundeck.services.NodeService$2.invokeMethod(NodeService.groovy)
        at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1272)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1166)
        at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
        at rundeck.services.NodeService$_2_reload_closure1.doCall(NodeService.groovy:96)
        at rundeck.services.NodeService$_2_reload_closure1.doCall(NodeService.groovy)
        at sun.reflect.GeneratedMethodAccessor946.invoke(Unknown Source)
        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:1016)
        at groovy.lang.Closure.call(Closure.java:423)
        at groovy.lang.Closure.call(Closure.java:417)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:251)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.batix.rundeck.AnsibleStepException: ERROR: Ansible execution returned with non zero code.
        at com.batix.rundeck.AnsibleRunner.run(AnsibleRunner.java:298)
        at com.batix.rundeck.AnsibleResourceModelSource.getNodes(AnsibleResourceModelSource.java:70)
        ... 82 more
WARN  LoggingResourceModelSourceCache: [ResourceModelSource: 2.source (Ansible Resource Model Source), project: Ansible-test] Returning cached model data

and with the edited inventory:

PLAY RECAP *********************************************************************
SERVER-01 : ok=3    changed=2    unreachable=0    failed=0
SERVER-02 : ok=2    changed=1    unreachable=0    failed=0
SERVER-06 : ok=2    changed=1    unreachable=0    failed=0
SERVER-08 : ok=2    changed=1    unreachable=0    failed=0
SERVER-09 : ok=2    changed=1    unreachable=0    failed=0
SERVER-17 : ok=2    changed=1    unreachable=0    failed=0
SERVER-18 : ok=2    changed=1    unreachable=0    failed=0
SERVER-19 : ok=2    changed=1    unreachable=0    failed=0
SERVER-20 : ok=2    changed=1    unreachable=0    failed=0
SERVER-21 : ok=2    changed=1    unreachable=0    failed=0

INFO  ExecutionUtilService: Execution successful: 41466

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 2
  • Comments: 22 (8 by maintainers)

Most upvoted comments

Hi @QUASARFREAK @javierurien @cwhits @rubal033 @telefax ,

This is resolved in release 2.0.0, please refer to the readme file for the full list of new features.

Thanks,