Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9.2.1-patch1: Python requirements install fails due to skipped var registration #820

Open
dwhitehead-splk opened this issue Apr 18, 2024 · 0 comments
Assignees

Comments

@dwhitehead-splk
Copy link

Issue

The 'when' condition added in this commit to roles/splunk_common/tasks/install_python_requirements.yml can result in the following fatal error in the event 'Check if requests_unixsocket exists' evaluates as true:

TASK [Install missing requests_unixsocket PY3] **************************************************** fatal: [localhost]: FAILED! => {"msg": "The conditional check 'requests_unixsocket_check_py3 is succeeded and (requests_unixsocket_check_py3.stdout | length == 0 or requests_unixsocket_check_py3.stdout.find(\"requests-unixsocket\") == -1)' failed. The error was: error while evaluating conditional (requests_unixsocket_check_py3 is succeeded and (requests_unixsocket_check_py3.stdout | length == 0 or requests_unixsocket_check_py3.stdout.find(\"requests-unixsocket\") == -1)): 'dict object' has no attribute 'stdout'\n\nThe error appears to be in '/opt/ansible/roles/splunk_common/install_python_requirements_local.yml': line 37, column 5, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: Install missing requests_unixsocket PY3\n ^ here\n"}

Root Cause

When 'Check if requests_unixsocket exists' evaluates as true, 'Check if pip3 unixsocket exits' is skipped, resulting in the requests_unixsocket_check_py3 var registering as the following object missing the expected stdout key:

TASK [requests_unixsocket_check_py3debug] ********************************************************* ok: [localhost] => { "requests_unixsocket_check_py3": { "changed": false, "skip_reason": "Conditional result was False", "skipped": true } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants