Foreman foreman_ansible plugin rest-api get ansible_roles

Hello Users,

Setup:
Foreman: 1.15.3
Foreman_ansible:1.4.5
Ansible:2.0.0.2

Currently i write a dynamic inventory script for my ansible server.

I want retrieve all hosts and ansible_roles from my foreman server over
the rest api.

To get all hosts works well but i cant receive the ansible_roles.

Url for all hosts -> https://foreman_server/api/v2/hosts (works well)

Url for ansible_roles -> https://foreman_server/api/v2/ansible/ansible_roles
(dont work)

Errormessage:
{"Status":"404","error":"Not found"}

I knew the restapi from Foreman and wrote a lot off scripts.
https://theforeman.org/api/1.15/index.html

But i cant see any documantation for foreman_ansible plugin and restapi
calls

Anyone an idea ?

Regards
mobios

Hello Users,
>

i swap from Foreman rest-api to directly query the Foreman database.
It works well.

Regards
mobios

Hello mobios,
the url for getting ansible roles from the api is
https://foreman_server/ansible/api/v2/ansible_roles .

You also should be able to access https://foreman_server/apidoc to see the
api documentation for your instance, which should also include docs for all
enabled plugins. Although I'm afraid the ansible api endpoints are not
described correctly there.

– Adam

··· On Tue, Aug 29, 2017 at 9:33 AM, mobios wrote:

Hello Users,

i swap from Foreman rest-api to directly query the Foreman database.
It works well.

Regards
mobios


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.