(ticket here: http://rundeck.lighthouseapp.com/projects/59277-development/tickets/495-node-execution-ordering-parameter#ticket-495-11)
This adds two new Job settings so that you can control the order in
which nodes are executed on. By default, as the behavior was in
earlier RunDeck versions, the nodes are ordered by name in ascending
order. You can now change the node attribute to rank by, and whether
it is ascending or descending order.
This would allow you to explicitly order the sequence of nodes
executed on by a Job, and, say, use the reverse order for a different
Job.
In the GUI editor for a Job, simply enter the node attribute under the
"Rank Attribute" field. Then choose Ascending or Descending. For Job
xml/yaml you can set the "rankAttribute" and "rankOrder" values under
"dispatch".
The ordering is done numerically as integer values if possible, so
"0100" is equivalent to "100". If the attribute values aren't
integers, the attribute values are ordered lexicographically (as
strings).
Another consideration is if the node doesn't have the specified
attribute value. In that case, node name is used as the secondary
rank attribute.
As an example, suppose you add a new "rank" attribute to your nodes:
node1:
rank: 10
node2:
color: blue
node3:
rank: 05
node4:
color: red
By default, the ordering would be by name, ascending:
node1,node2,node3,node4. If you changed to descending it would
reverse that order.
If you set the rankAttribute to "rank", ascending, it would be:
node3,node1,node2,node4. This is because node3's "rank" value "05"
is numerically lower than node1's value of "10". As well, since node2
and node4 have no "rank" attribute, they are placed last and then
sorted by name.
If you again used rankAttribute of "rank" but changed to descending
order, it would be the reverse: node4,node2,node1,node3.
Essentially, order by the rank attribute first, then by name. if
descending, reverse everything.
Please let me know what you think about this mechanism, and if you
have any questions.
thanks,
Greg