I am working on deleting the hosts which are generated dynamically by integrating Ansible with ServiceNow CMDB.
For this I am creating workflow in ansible tower with 2 jobs. The first one will be python script(inventory sync) which will generate hosts and the second one is a playbook which has to delete hosts using ansible API's.
I am able to delete the hosts by providing id of the inventory source manually in playbook. Link which I am providing in playbook is: 'htps:///api/v2/inventory_sources/{id}/groups/'.
But I want to get the id of the inventory source from the 1st job when the workflow runs and it must be passed dynamically to 2nd job. please share your ideas how to do this?
I am working on deleting the hosts which are generated dynamically by integrating Ansible with ServiceNow CMDB.
For this I am creating workflow in ansible tower with 2 jobs. The first one will be python script(inventory sync) which will generate hosts and the second one is a playbook which has to delete hosts using ansible API's.
I am able to delete the hosts by providing id of the inventory source manually in playbook. Link which I am providing in playbook is: 'htps:///api/v2/inventory_sources/{id}/groups/'.
But I want to get the id of the inventory source from the 1st job when the workflow runs and it must be passed dynamically to 2nd job. please share your ideas how to do this?