ansible / ansible-runner-service

Other
201 stars 66 forks source link

Sending limit to API service #82

Closed idenkov closed 4 years ago

idenkov commented 4 years ago

Hey,

I am testing the service, but it seems to me it is not possible to send "limit" parameter. When added to the payload the service does not send it to ansible and roles are applied to all the invetory.

POST /api/v1/playbooks/base.yml, parms={'limit': '127.0.0.1'} This is what I am seeing in the logs coming to the service, and that playbook run on every host in the inventory.

How can I send either invetory or limit to the playbooks to target specific hosts?

jmolmo commented 4 years ago

Hey,

I am testing the service, but it seems to me it is not possible to send "limit" parameter. When added to the payload the service does not send it to ansible and roles are applied to all the invetory.

POST /api/v1/playbooks/base.yml, parms={'limit': '127.0.0.1'} This is what I am seeing in the logs coming to the service, and that playbook run on every host in the inventory.

How can I send either invetory or limit to the playbooks to target specific hosts?

Limit works .. but use an IP address different from the IPv4 loopback standar address :-) ( it applies to every node). Another possibility.. use inventory groups including the hosts where you want to execute a playbook.

idenkov commented 4 years ago

Hey, I am testing the service, but it seems to me it is not possible to send "limit" parameter. When added to the payload the service does not send it to ansible and roles are applied to all the invetory. POST /api/v1/playbooks/base.yml, parms={'limit': '127.0.0.1'} This is what I am seeing in the logs coming to the service, and that playbook run on every host in the inventory. How can I send either invetory or limit to the playbooks to target specific hosts?

Limit works .. but use an IP address different from the IPv4 loopback standar address :-) ( it applies to every node).

It was just an example, I am sending real ip.

idenkov commented 4 years ago

Also I am not seeing how to add hosts through the API, the /hosts endpoint does not accept POST requests. How do I manage the hosts?

mnecas commented 4 years ago

@idenkov for adding hosts please check the /api/v1/groups/<group_name> section in /api around the limit, we had no issues and use it often

idenkov commented 4 years ago

@mnecas Thank you! Will take a look.