Skip to content

Deleting hosts in Ansible tower dynamically. #13

@arun31101992

Description

@arun31101992

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions