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

Revert ansible interpreter #32

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

jsmcnair
Copy link

This is probably a bit of an edge case, but I noticed an issue when using this role.

To replicate the issue, you would have to have a playbook that delegates a task to localhost once the plays in this role have completed. I was getting a permission denied on the path to the python in the virtualenv, presumably because it doesn't exist on localhost.

The fix is to flag that the interpreter has been changed and revert to the 'discovered' python interpreter at the end of the plays in the role.

- name: "Revert python interpreter"
set_fact:
ansible_python_interpreter: "{{ ansible_facts['discovered_interpreter_python'] }}"
when: revert_python_interpreter is defined and revert_python_interpreter == true
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about changing the when condition to when: ansible_os_family in ['RedHat', 'Darwin'] to match the when condition for when the virtualenv tasks are executed? That way, we don't need to use a custom fact.

@@ -33,7 +33,7 @@
- name: setuptools>44.0.0,<45.0.0
state: present
- name: pyOpenSSL
- name: boto
- name: boto3
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RHEL/CentOS 7 won't have Python 3 installed and boto3 now only supports Python 3. Could you please pin to version 1.17.112 when using RHEL/CentOS 7?

@mprahl
Copy link
Owner

mprahl commented Aug 5, 2022

@jsmcnair are you planning on addressing the feedback in the PR?

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