Skip to content
Snippets Groups Projects
Commit 8ceb4150 authored by Vasilis Tsiligiannis's avatar Vasilis Tsiligiannis
Browse files

satnogs-client: Recreate virtualenv on Python mismatches

parent 361a219d
Branches
Tags 201912112036
No related merge requests found
......@@ -22,6 +22,11 @@
with_items: '{{ satnogs_client_packages }}'
notify:
- Restart satnogs-client service
- name: Get virtualenv Python version # noqa 306
shell: '/var/lib/{{ satnogs_client_user }}/bin/python --version 2>&1 | awk ''/^Python/ { print $2 }'''
become: true
register: res_python_version
changed_when: false
- name: Check for virtualenv with no access to global site-packages
stat:
path: '/var/lib/{{ satnogs_client_user }}/lib/python2.7/no-global-site-packages.txt'
......@@ -31,7 +36,7 @@
file:
path: '/var/lib/{{ satnogs_client_user }}/{{ item }}'
state: 'absent'
when: res_no_global.stat.exists and res_no_global.stat.isreg
when: (res_no_global.stat.exists and res_no_global.stat.isreg) or res_python_version.stdout != ansible_python_version
register: res
until: res is success
retries: 3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment