Run a Ansible Playbook

I want to know if there is a job template that runs an Ansible Playbook located on the Foreman host and running it on the selected hosts without going through the roles.

For example :

We select hosts that we want to apply a configuration

We run a job template with remote execution plugin

And let see if the playbook run correctly

Thanks !

Hey @vivitare,

As far as I can tell, there is no such direct role BUT it’s very easy and straightforward to create your own job template for which you can even add Input Parameters (it’s on the second tab if you create a Job Template).

The downside, however, is that it doesn’t list the roles known to ansible so you’d have to provide a list of possible roles to select, either by hard-coding it in your template (as in, you want to execute a role which sets up a webserver) or allowing a user to select a role as input parameter, for which you can even provide a list of possible roles (e.g. web-server, mail-server, FTP-server).

You also see something similar being done for the “Ansible SSH commands” job, in which a small template was created, which lets one input a specific command to be executed via ansible (e.g. ping)

Kind regards,
Arend

Thanks for taking the time to respond !

I will do research but for now I’m having problems with the plugin Ansible that I can not fix … I’ll contact you if I have other questions thank you!