rundeck-plugins / ansible-plugin

Ansible Integration for Rundeck
MIT License
331 stars 100 forks source link

Ansible integration running ansible-playbook on different host #283

Open msperl opened 4 years ago

msperl commented 4 years ago

Hi!

Is there a way to run ansible scripts on a different host than rundeck.

For now we just run a shell to the host and run the ansible command there manually.

So it should not be "that" complex to impement this minimal forwarding of just the ansible command to a dedicated ansible host.

Use case can also be running ansible scripts that are requireing different versions of ansible.

Thanks

msperl commented 1 year ago

well, as a workarround something like this seems feasable with the custom ansible binary location setting, where obviously a wrapper script can get written to run the file on the remote node - but obviously this does not work for ad coc commands where one needs to copy files first, but at least it works with playbooks. Inventory is already becoming hard...

simon-c-msc commented 1 year ago

You should be able to accomplish this using Ansible Playbook and Ansible Inline playbook steps and targeting your remote host in the Nodes selection tab of the Job.

Is there a reason that would not work?

msperl commented 1 year ago

i believe you missunderstood me!

I want to control on which host the ansible-playbook command is run not the arguments of --limitto ansible-playbook!

I guess with a later version I can work arround that by using a wrapper ansible command that basically does an ssh and executes it there (but with one slight drawback: the direcory still needs to exist on the host where rundeck itself is running)

simon-c-msc commented 1 year ago

In the community version of Rundeck, the ansible-playbook command will always be executed on the Rundeck since it's the controller.

Are you trying to use another server as a jump host?

If you have the enterprise version you can setup specific cluster nodes pre-project or use the new Enterprise Runner feature.