VMware Aria Automation fails to remove machines from the Ansible inventory during disposal of deployments.
search cancel

VMware Aria Automation fails to remove machines from the Ansible inventory during disposal of deployments.

book

Article ID: 318345

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

Symptoms:
  • VMware Aria Automation (Formerly VMware vRealize Automation) fails to remove machines from the Ansible inventory during disposal of deployments.
  • Destroying machines fails due to a parsing failure.  Errors may include:
Unable to parse inventory to obtain existing groups JSON for host <host FQDN or IP>.
​​Ensure inventory is valid and host exists.. Refer to logs located at: var/tmp/vmware/provider/user_defined_script/<Deployment ID> on Ansible Control Machine for more details.
  • When reviewing the Ansible logs you may see the error:   
CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  • There is nothing returned when executing the following on the Ansible host:
which python
  • To confirm issue, use the following command to see if you receive the Cryptography deprecation warning (replacing host and inventory Path with your ansible host and full path to inventory file):  
ANSIBLE_STDOUT_CALLBACK=json ANSIBLE_LOAD_CALLBACK_PLUGINS=true ansible {host} -m debug -a var=group_names -i {inventoryPath}


Environment

VMware vRealize Automation 8.x

Cause

  • VMware Aria Automation fails to read the output of the hosts file when a deprecation warning is introduced in the output.
  • If Ansible is deployed in a non-PIP environment, there may be a problem with the python symbolic link

Resolution

To work around this issue in a PIP environment you will need to perform one of the following:
  1. Backup your Ansible Host prior to making changes.
  2. Downgrade the Cryptography module on Python from version 3 to 2 on your Ansible Host or Uninstall the Python Cryptography module from the Ansible host (if not in use).
  3. Use python3 as the default Ansible python module so that the versions match. The Python module that is used by Ansible is displayed when executing:
ansible --version
  1. Rebuild the symlink using the commands:
rm rf /usr/bin/python
ln -s /usr/bin/python3 /usr/bin/python