Project

General

Profile

Actions

Feature #17802

closed

Playbook execution on hostgroup-level and API extensions for triggering playbooks

Added by Daniel Kuffner about 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

As a Devops I want to be able to execute ansible via rest api on selected hosts or host groups in order to automate certain use cases or to build a custom command-line tool or webui

Actions #1

Updated by Daniel Kuffner about 8 years ago

  • Subject changed from As a Devops I want to be able to execute ansible via http api on selected hosts or host groups to Playbook execution on hostgroup-level and API extensions for triggering playbooks

Playbook execution on hostgroup-level and API extensions for triggering playbooks

In some situations, it is necessary to run to run Ansible roles not only for each host separately, but also for all members of a hostgroup in parallel. Therefore, there should be a way to trigger Ansible plays for hostgroups without splitting the playbook execution into subtasks for each host. This is of special interest if a configuration process spans multiple systems at the same time (for example cluster provisions).
In addition to that, playbooks should also be able to be triggered using the v2 API, such that the user does not need to rely on the Foreman UI to trigger Ansible roles.
Proposed new endpoints for the extending the API are:

POST request including expected body

http://<foreman_host>/ansible/api/v2/play_roles_on_host
{
    "play_roles":
    {
    "host_ids": [<comma-separated-host-ids>] # optional
    "host_names": [<comma-separated-host-names>] # optional
    }
}

POST request including expected body


http://<foreman_host>/ansible/api/v2/play_roles_on_hostgroup
{
    "play_roles":
    {
    "hostgroup_ids": [<comma-separated-hostgroup-ids>] # optional
    "hostgroup_names": [<comma-separated-hostgroup-names>] # optional
    }
}

Actions #2

Updated by The Foreman Bot about 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_ansible/pull/67 added
Actions #3

Updated by Anonymous almost 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #4

Updated by Fabien Brachere almost 6 years ago

  • Found in Releases foreman-ansible 2.3.1 added

It seems that this feature doesn't work anymore.
With the latest version (2.3.1), we've got one playbook execution per host.

Actions

Also available in: Atom PDF