vmware / ansible-for-nsxt

Ansible delivers simple IT automation that ends repetitive tasks and frees up DevOps teams for more strategic work. This project is to enable this automation for NSX-T installation.
Other
171 stars 145 forks source link

Ansible swallows OS error output when ovftool fails to run #430

Open neil-wwt opened 2 years ago

neil-wwt commented 2 years ago

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