Project

General

Profile

Actions

Feature #13812

closed

Remote execution provider

Added by Daniel Lobato Garcia about 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Fixed in Releases:
Found in Releases:

Description

Ansible can be used as a provider for remote execution. The job templates can be Ansible playbooks that use host parameters, properties and ERB.
Job templates, however, should have a 'hosts' section that just contains <%= @host.name %>, because a new inventory is generated per host with all the required variables.
In any case, the way it should work is:

Foreman sends request to proxy - including the 'hosts' it's supposed to run on.
Proxy generates an inventory with the hosts and variables required
Proxy runs ansible and reports to Foreman

The reason why ansible_foreman_inventory cannot be used in this case is because it's less flexible than the 'search' field of REX, where one can use the 'scoped_search' syntax to figure out what hosts to run the playbook on. If we used ansible_foreman_inventory for that, we would be forced to run our playbooks on a set of hosts, hostgroups, organiztions or locations.


Related issues 2 (0 open2 closed)

Blocks Ansible - Tracker #22024: Ansible as a Remote Execution providerClosed12/18/2017

Actions
Precedes Ansible - Feature #22018: Change PlayHostRoles to rely on REXCore providerClosedDaniel Lobato Garcia02/22/201602/22/2016Actions
Actions

Also available in: Atom PDF