Troubleshooting
Problem
Installation of PowerVC v2.0.2 and later may fail because of umask.
Symptom
Based on the login type, the /etc/bashrc and /etc/profile are executed.
"fatal: []: FAILED! => {"changed": true, "cmd": ["grep", "cluster =", "/opt/ibm/powervc/version.properties"], "delta": "0:00:01.003588", "end": "2022-02-18 16:48:04.886938", "msg": "non-zero return code", "rc": 1, "start": "2022-02-18 16:48:03.883350", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}"
TASK [pvc_precheck : get cluster name from /opt/ibm/powervc/version.properties] ***
fatal:[]: FAILED! => {"changed": true, "cmd": ["grep", "cluster =", "/opt/ibm/powervc/version.properties"], "delta": "0:00:01.003588", "end": "2022-02-18 16:48:04.886938", "msg": "non-zero return code", "rc": 1, "start": "2022-02-18 16:48:03.883350", "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}
...ignoring
Friday 18 February 2022 16:48:22 -0500 (0:00:00.452) 0:00:23.385 *******
fatal: []: FAILED! => {
"assertion": "umask_value.stdout == \"0022\" or umask_value.stdout == \"022\"",
"changed": false,
"evaluated_to": false,
"msg": "umask permissions check failed"
}
"TASK [pvc_precheck : check umask permissions] **********************************"
"fatal: []: FAILED! => {"
"assertion": "umask_value.stdout == \"0022\" or umask_value.stdout == \"022\"",
"changed": false,
"evaluated_to": false,
"msg": "umask permissions check failed"
}
Environment
Supported versions of RHEL.
Resolving The Problem
Based on the login type, the /etc/bashrc and /etc/profile are executed.
In Linux, there are two types of login shells - interactive shells and non-interactive shells. Interactive shell requires user input (Example: typical Bash prompt) , while non-interactive shell are run by scripts (Example: a Bash script execution or a sub shell) .
/etc/profile is executed only for interactive shell; whereas, /etc/bashrc is executed for both interactive and non-interactive shells.
In this case, Ansible starts a non-interactive shell by creating a sub shell using /etc/bashrc file to manage umask. Child processes do not recognize the umask value set in /etc/profile but recognize the value in /etc/bashrc.
To resolve this issue, modify umask value in /etc/bashrc
To:
if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
umask 0022
else
umask 022
fi
Document Location
Worldwide
[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS2MT9","label":"PowerVC"},"ARM Category":[{"code":"a8m50000000L0jDAAS","label":"PowerVC"}],"ARM Case Number":"","Platform":[{"code":"PF016","label":"Linux"}],"Version":"2.0.2;and future releases"}]
Was this topic helpful?
Document Information
Modified date:
15 March 2022
UID
ibm16560030