rundeck-plugins / rundeck-ec2-nodes-plugin

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

Jobs set to "Dispatch to Nodes" don't dispatch to nodes #15

Closed dangermccann closed 10 years ago

dangermccann commented 10 years ago

When I create a job that is intended to be dispatched to nodes that are discovered by this plugin, the job actually runs on the local rundeck host, not the target EC2 node. This problem is unique to nodes that are discovered by this plugin. If I manually add the EC2 node to my resources.xml file, the job is correctly dispatched to the node.

The XML below will output the hostname of the rundeck server, not the hostname of the target node.

<joblist>
  <job>
    <id>bd503489-d40f-48c5-ac36-15c670a9b80e</id>
    <loglevel>INFO</loglevel>
    <sequence keepgoing='false' strategy='node-first'>
      <command>
        <scriptargs />
        <script><![CDATA[
hostname -f
echo "fu"
]]></script>
      </command>
    </sequence>
    <description></description>
    <name>FU</name>
    <context>
      <project>XRE-Guide</project>
    </context>
    <dispatch>
      <threadcount>1</threadcount>
      <keepgoing>false</keepgoing>
      <excludePrecedence>true</excludePrecedence>
      <rankOrder>ascending</rankOrder>
    </dispatch>
    <uuid>bd503489-d40f-48c5-ac36-15c670a9b80e</uuid>
    <nodefilters>
      <filter>.*target.*</filter>
    </nodefilters>
  </job>
</joblist>
gschueler commented 10 years ago

what are the node definitions that you get out of the ec2 plugin? specifically, what is the hostname value set to?

you can view the XML for all of the nodes by entering the following URL after logging into rundeck:

http://<rundeck>/api/11/project/<projectname>/resources

What is the mapping configuration you use for the ec2 plugin?

dangermccann commented 10 years ago

It looks like some of the hostnames are empty strings. But others are not. The ones that have the hostname set to an empty string are the ones that aren't working. Why are some hostnames not being set?

dangermccann commented 10 years ago

OK, user error. These VMs are in a private VPC. I have fixed the issue by adding this to my mapping: hostname.selector=privateDnsName