Possible to use Rundeck nodes as Ansible inventory?

1.1k Views Asked by At

I have an installation of Rundeck that works well for "ordinary" usage: Running commands/scripts, etc on remote hosts. We also use Ansible elsewhere in the organization so I thought it would be a good idea to try using the Ansible plugin for some things, so that Ansible can do the heavy lifting on certain tasks that it's very good at, such as adding users, installing packages, and so on.

However, I'm running into the issue that the Ansible plugin for Rundeck seems to require its own inventory, separate from the nodes that I have already configured in Rundeck.

For example, I create a job with a Workflow Step using an Ansible Module. I select "Dispatch to Nodes" and select some subset of nodes. When I run the job, I get:

[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'
[WARNING]: Could not match supplied host pattern, ignoring: foo
[WARNING]: Could not match supplied host pattern, ignoring: bar

Everything I can find on this topic talks about importing an existing Ansible inventory into Rundeck as nodes. I guess I want to go the opposite direction: Rundeck nodes to Ansible inventory. Is this even possible? I don't want to have to maintain two separate lists of hosts that I want to run Rundeck jobs against (Nodes for Rundeck, and an Ansible inventory for Rundeck+Ansible.)

If it's not possible, then I confess to not really seeing the point of the Ansible Plugin to begin with since it just becomes a thin UI wrapper around a command that I could write by hand anyway.

1

There are 1 best solutions below

0
On

Following this, you can add a file model source (with a set of nodes defined at resources.xml file for example, check the step 3) with your Ansible Node Executor, and use it like ansible inventory (using your playbook on those nodes).