ara_api role: provide sensible PATH defaults without venv

When deploying without a virtualenv, we need to supply a PATH where the
python and ara-manage binaries are likely to be found.

Change-Id: Ie9b498f988a026a2568cc445ef444fe2f90c837b
This commit is contained in:
David Moreau Simard
2019-09-25 09:08:52 -04:00
parent 84cb73eae3
commit 2feed6d7d1
5 changed files with 6 additions and 6 deletions

View File

@@ -49,7 +49,7 @@
block:
- name: Generate a random secret key
environment:
PATH: "{{ path_with_virtualenv | default(omit) }}"
PATH: "{{ path_with_virtualenv | default('/usr/bin:/usr/local/bin') }}"
command: python3 -c "from django.utils.crypto import get_random_string; print(get_random_string(length=50))"
no_log: yes
register: generated_key

View File

@@ -45,5 +45,5 @@
- name: Run SQL migrations
environment:
ARA_SETTINGS: "{{ ara_api_settings }}"
PATH: "{{ path_with_virtualenv | default(omit) }}"
PATH: "{{ path_with_virtualenv | default('/usr/bin:/usr/local/bin') }}"
command: ara-manage migrate

View File

@@ -45,5 +45,5 @@
- name: Run SQL migrations
environment:
ARA_SETTINGS: "{{ ara_api_settings }}"
PATH: "{{ path_with_virtualenv | default(omit) }}"
PATH: "{{ path_with_virtualenv | default('/usr/bin:/usr/local/bin') }}"
command: ara-manage migrate

View File

@@ -26,5 +26,5 @@
become: "{{ (ansible_user_dir in ara_api_database_name) | ternary(false, true) }}"
environment:
ARA_SETTINGS: "{{ ara_api_settings }}"
PATH: "{{ path_with_virtualenv | default(omit) }}"
PATH: "{{ path_with_virtualenv | default('/usr/bin:/usr/local/bin') }}"
command: ara-manage migrate

View File

@@ -49,8 +49,8 @@
- name: Get ARA plugins directory
environment:
PATH: "{{ path_with_virtualenv | default(omit) }}"
command: python -m ara.setup.plugins
PATH: "{{ path_with_virtualenv | default('/usr/bin:/usr/local/bin') }}"
command: python3 -m ara.setup.plugins
changed_when: false
register: ara_setup_plugins