Merge "ara_api: use current PATH if no virtualenvs are used"
This commit is contained in:
commit
9be44da985
|
@ -49,7 +49,7 @@
|
|||
block:
|
||||
- name: Generate a random secret key
|
||||
environment:
|
||||
PATH: "{{ path_with_virtualenv | default('/usr/bin:/usr/local/bin') }}"
|
||||
PATH: "{{ path_with_virtualenv }}"
|
||||
command: python3 -c "from django.utils.crypto import get_random_string; print(get_random_string(length=50))"
|
||||
no_log: "{{ ara_api_secure_logging }}"
|
||||
register: generated_key
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
- name: Run SQL migrations
|
||||
environment:
|
||||
ARA_SETTINGS: "{{ ara_api_settings }}"
|
||||
PATH: "{{ path_with_virtualenv | default('/usr/bin:/usr/local/bin') }}"
|
||||
PATH: "{{ path_with_virtualenv }}"
|
||||
command: ara-manage migrate
|
||||
run_once: true
|
||||
register: _ara_sql_migrations
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
- name: Run SQL migrations
|
||||
environment:
|
||||
ARA_SETTINGS: "{{ ara_api_settings }}"
|
||||
PATH: "{{ path_with_virtualenv | default('/usr/bin:/usr/local/bin') }}"
|
||||
PATH: "{{ path_with_virtualenv }}"
|
||||
command: ara-manage migrate
|
||||
run_once: true
|
||||
register: _ara_sql_migrations
|
||||
|
|
|
@ -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('/usr/bin:/usr/local/bin') }}"
|
||||
PATH: "{{ path_with_virtualenv }}"
|
||||
command: ara-manage migrate
|
||||
|
|
|
@ -27,3 +27,8 @@
|
|||
package:
|
||||
name: "{{ ara_distribution_packages }}"
|
||||
state: present
|
||||
|
||||
# This lets us use "path_with_virtualenv" without conditions everywhere
|
||||
- name: Don't prefix the virtualenv bin directory to PATH
|
||||
set_fact:
|
||||
path_with_virtualenv: "{{ ansible_env.PATH }}"
|
||||
|
|
|
@ -33,3 +33,9 @@
|
|||
set_fact:
|
||||
path_with_virtualenv: "{{ ara_api_venv_path }}/bin:{{ ansible_env.PATH }}"
|
||||
when: ara_api_venv | bool
|
||||
|
||||
# This lets us use "path_with_virtualenv" without conditions everywhere
|
||||
- name: Otherwise don't prefix the virtualenv bin directory to PATH
|
||||
set_fact:
|
||||
path_with_virtualenv: "{{ ansible_env.PATH }}"
|
||||
when: not ara_api_venv | bool
|
||||
|
|
Loading…
Reference in New Issue