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

Figure out how to handle Python in venv for delegated tasks #16

Open
bjschafer opened this issue Jul 13, 2023 · 0 comments
Open

Figure out how to handle Python in venv for delegated tasks #16

bjschafer opened this issue Jul 13, 2023 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@bjschafer
Copy link
Owner

Right now, the version check in the fluidd role relies on the github3 Python module. To avoid clutter on target Pis, the module is installed on the host running Ansible.

However, it seems that when running a task with delegate_to: localhost, Ansible finds the system default Python interpreter and not the one in the venv that it was invoked with.

For now, the workaround is to add a block like this in inventory.yaml:

all:
  hosts:
    localhost:
      ansible_connection: local
      ansible_python_interpreter: /path/to/your/venv/bin/python3

...and then run with ansible-playbook test-playbook.yaml --limit '!localhost'.

@bjschafer bjschafer added bug Something isn't working help wanted Extra attention is needed labels Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant