Error while deploying

We’re consistently receiving the following error on a new deployment. The environment is a QA server on a VMWare virtual machine:

TASK [nodejs : Add nodejs apt key] *******************************************

fatal: [192.168.100.21]: FAILED! => {"changed": false, "cmd": "/usr/bin/apt-key add -", "msg": "Warning: apt-key output should not be parsed (stdout is not a terminal)\nE: This command can only be used by root.", "rc": 1, "stderr": "Warning: apt-key output should not be parsed (stdout is not a terminal)\nE: This command can only be used by root.\n", "stderr_lines": ["Warning: apt-key output should not be parsed (stdout is not a terminal)", "E: This command can only be used by root."], "stdout": "", "stdout_lines": []}

Any help would be appreciated!

An update to this - we were unable to resolve the issue and began a fresh installation and did not encounter this issue, so unfortunately I can’t comment on the solution.

What we did notice, however, is that by default the client’s Ubuntu repo mirrors were being configured for Zimbabwean based servers - this appeared to be causing intermittent issues with some downloads where server resolution would time out. We kept retrying until it was resolved, but next time we may opt for an international repo which, although possibly slower, would likely be more reliable.