Open rossigee opened 3 years ago
Describe the bug
When run against a host with no root password set, exits with positive exitcode, failing the run.
TASK [florianutz.ubuntu2004_cis : PRELIM | Gather accounts with empty password fields] ********************************************************************************************************************** ok: [sg0host1] fatal: [sg0admin3]: FAILED! => {"changed": false, "cmd": "set -o pipefail; cat /etc/shadow | awk -F: '($2 == \"\" ) {j++;print $1; } END {exit j}'", "delta": "0:00:00.015997", "end": "2021-03-19 10:21:28.579102", "msg": "non-zero return code", "rc": 1, "start": "2021-03-19 10:21:28.563105", "stderr": "", "stderr_lines": [], "stdout": "root", "stdout_lines": ["root"]} ok: [sg0host2]
root@sg0admin3:/home/ross# set -o pipefail; cat /etc/shadow | awk -F: '($2 == "" ) {j++;print $1; } END {exit j}' root root@sg0admin3:/home/ross# echo $? 1
To Reproduce
Steps to reproduce the behavior:
passwd -d <some_login>
Expected behavior
A zero exit code, allowing the role to proceed.
Software (please complete the following information):
Additional context
Workaround is passwd -l <some_login>
passwd -l <some_login>
Describe the bug
When run against a host with no root password set, exits with positive exitcode, failing the run.
To Reproduce
Steps to reproduce the behavior:
passwd -d <some_login>
on a host.Expected behavior
A zero exit code, allowing the role to proceed.
Software (please complete the following information):
Additional context
Workaround is
passwd -l <some_login>