I am currently exploring Runddeck to manage several 100 VMs at the time. Rundeck is a very useful tool to run scripts/ commands on multiple machines at the time (each script is passed to the remote machine and then executed locally). However I wonder if there is a way of implementing the following system administation scenario.
Rundeck job requirments (Example: Observium)
/opt/observium/add_device.php v2c @node.name@ ${varSNMPCommunity}
I don't have enough reputation to include images in this post. Please use the link below to see the flow diagram.
https://www.dropbox.com/s/2zt4r9trulpsaqx/RundeckObservium.png?dl=0
Rather than have the script run on one node to get a list of machines, try using a node filter to see if you can have RunDeck determine the target nodes from a tag. This will depend on how your project is configured to acquire resources.
For example, if you're using tags then you may want to have a tag that meets your condition. Say you want to find machines that match a tag you created called RebootPending
. You can use that as the job's node filter to send a reboot command to those hosts.
Another possible option might be to have your step 2 script output a JSON formatted file to a web server. You can then configure your RD job with an Option that reads this remote URL (a list of host, perhaps) and then take an action based on that list. The job option and node filter can be configured thusly:
Option Name: inputFilter
Description: Used for targeting nodes
Default Value: (empty)
Input Type: [X]Plain text [ ]Secure [ ]Secure Remote Authentication
Allowed Values: [ ]List [X]Remote URL
Node Filter: tags:${option:inputFilter}
By using these setup, you can have the remote web page (e.g., your script's output) determine the target nodes. Note that the RunDeck JSON format is specific and doesn't report read errors well. Pay close attention to the Rundeck User Guide - Option model provider
If this is not a viable approach, you may need to consider using a different tool such as Jenkins.