Skip to content

Conversation

@justinc1
Copy link
Collaborator

https://github.com/ScaleComputing/HyperCoreAnsibleCollection/actions/runs/4686722374/jobs/8305135195#step:9:48 Here ansible_python_interpreter was not defined.

See also ansible/ansible#21311 and https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html I missed before that ansible_python_interpreter is not always defined.

We do not want to force user to tell us some valid python interpreter. Also, it would be possible that the only availble python is in venv or in /usr/local/bin (python docker images).

ansible_playbook_python looks like a suitable fallback. It is interpreter on the controller node. Our script will always run there - we never ssh to HyperCore controller.

https://github.com/ScaleComputing/HyperCoreAnsibleCollection/actions/runs/4686722374/jobs/8305135195#step:9:48
Here ansible_python_interpreter was not defined.

See also ansible/ansible#21311 and
https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html
I missed before that ansible_python_interpreter is not always defined.

We do not want to force user to tell us some valid python interpreter.
Also, it would be possible that the only availble python is in venv or
in /usr/local/bin (python docker images).

ansible_playbook_python looks like a suitable fallback.
It is interpreter on the controller node. Our script will always run
there - we never ssh to HyperCore controller.

Signed-off-by: Justin Cinkelj <justin.cinkelj@xlab.si>
@justinc1 justinc1 requested a review from PolonaM April 13, 2023 09:32
@justinc1 justinc1 self-assigned this Apr 13, 2023
@justinc1
Copy link
Collaborator Author

Dry-running this example - https://github.com/ScaleComputing/HyperCoreAnsibleCollection/actions/runs/4687678208/jobs/8307275009#step:9:45. It does not complain about "'ansible_python_interpreter' is undefined" anymore.

It does fail later, because example is tested in check mode, so command is not really run, and we do not get stdout_lines. But this is not problem with code, it is problem how we test the examples.

@justinc1 justinc1 merged commit 5fc3b3d into main Apr 13, 2023
@justinc1 justinc1 deleted the fix-interpreter-for-check_local_time branch April 13, 2023 09:35
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

Successfully merging this pull request may close these issues.

3 participants