Inventory hosts in Ansible Tower are not cleaned up when a Deployment is deleted
search cancel

Inventory hosts in Ansible Tower are not cleaned up when a Deployment is deleted

book

Article ID: 325877

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Symptoms:
  • You have a resource deployed from vRealize Automation 8.x with Ansible Tower integration.
  • You attempt to delete the deployment with an Ansible Tower resource
    • The hosts are not cleaned, resulting in deleted hosts orphaned within the Ansible Tower inventory.


Environment

VMware vRealize Automation 8.x

Cause

This behavior is only observed when de-provision templates are not specified within the vRA Cloud template.

Resolution

This issue is resolved in vRealize Automation 8.10.1.  See the Workaround section below for additional information.

Workaround:
Specify the de-provision templates within the cloud template. The de-provision templates should use the same inventory as the templates run during the provision flow.

Example vCloud Template IaC YAML Syntax

Tower-Agent:
    type: Cloud.Ansible.Tower
    properties:
      ...
      templates:
        provision:
          - name: install_apache_server
        de-provision:
          - name: uninstall_apache_server
        ...

'uninstall_apache_server' should use the same inventory as 'install_apache_server'