0

I want to use zabbix server to auto-discover linux servers and make a trigger for ansible awx to install zabbix agent on the newly discovered server.
I have followed this tutorial. The difference is that I want to use a workflow template that first does inventory sync, then executes the job of zabbix agent installation.

From the zabbix server side, I have a trigger configuration that calls awx api as follows: /usr/bin/curl -kH "Content-Type: application/json" -H "Authorization: Bearer 07nof8zwL5qRe1ITzSCDTyDGe2CHD3" -X POST http://AWX_IP:8080/api/v2/workflow_job_templates/16/launch/ -d '{ "limit": "{HOST.CONN}", "credentials": [3]}'
So here I pass the current discovered host as {HOST.CONN} to the awx api.

And on the ansible awx side, it does not limit the host executed. All hosts of the inventory are executed installing zabbix agent. I also remove the inventory sync and leave only one job which is zabbix agent installation but it still not works. So it looks like the limit parameter is ignored when passing to workflow job. How do I correctly set the host limit to workflow job?

Does anyone has encountered this before or any suggestions? Thanks in advance.

James
  • 1
  • 1
  • In the Job template, there is an option named Limit. Have you tired to give your server name there? – Smily Aug 05 '19 at 11:13
  • 1
    @Ash That could work. But what I want is to limit the server in a dynamic way by giving it from zabbix server. – James Aug 06 '19 at 01:09

0 Answers0