ansible-for-nsxt icon indicating copy to clipboard operation
ansible-for-nsxt copied to clipboard

Ansible swallows OS error output when ovftool fails to run

Open neil-wwt opened this issue 2 years ago • 0 comments

Describe the bug

When plugins/modules/nsxt_deploy_ova.py is run via a task, and a library is not present, that error is swallowed and not displayed. The ovftool output is empty, no logs are produced and the exit code is 127. This is very confusing to the user.

In my case, the ovftool was being run on a CentOS 8 container that was lacking libnsl When running the playbook the error was

msg: 'Failed to deploy OVA, error message from ovftool is: , the comand was [''/ovftool/ovftool'',...

But when running ovftool directly the output was

/ovftool/ovftool.bin: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory

Reproduction steps

1. On CentOS 8, run `vmware.ansible_for_nsxt.nsxt_deploy_ova`

I can provide more detailed production steps using the included tests later, but can't copy-paste everything that I am running right now.

Expected behavior

When there is an error running ovftool,

  1. Exit code is returned. eg Exit code was: 127
  2. Error from the OS is returned. eg /ovftool/ovftool.bin: error while loading shared libraries: libnsl.so.1: cannot open shared object file

Additional context

No response

neil-wwt avatar May 18 '22 19:05 neil-wwt