Fix #7: make python version configurable

Introduced a variable that allows the python version to be configured
Default is python3

Vagrant check are ok ✓
This commit is contained in:
Emmanouil Kampitakis 2019-03-14 20:47:16 +01:00
parent f320db01e2
commit d5200f1122
3 changed files with 5 additions and 3 deletions

View file

@ -39,6 +39,7 @@ The following should be present on the target system
| matrix_synapse_log_days_keep | 30 |
| matrix_synapse_deployment_method | pip | Either pip or docker [¹](#footnote_1) |
| matrix_synapse_supervision_method | systemd | Either systemd, runit or docker [¹](#footnote_1) |
| matrix_synapse_python_version | 3 | Default python version (2, 3) to be used |
<a name="footnote_1">¹</a>: Docker must be used for both or neither deployment and supervision

View file

@ -13,3 +13,4 @@ matrix_synapse_skip_tls: false
matrix_synapse_pid_file: "{{ matrix_synapse_base_path }}/synapse.pid"
matrix_synapse_docker_ports: ["8008:8008", "8448:8448"]
matrix_synapse_docker_labels: {}
matrix_synapse_python_version: "3"

View file

@ -30,7 +30,7 @@
- psycopg2-binary
- mock
virtualenv: "{{ matrix_synapse_base_path }}/env"
virtualenv_python: python2.7
virtualenv_python: "python{{ matrix_synapse_python_version }}"
extra_args: --upgrade
tags:
- pre_install
@ -49,7 +49,7 @@
pip:
name: "{{ matrix_synapse_base_path }}/synapse"
virtualenv: "{{ matrix_synapse_base_path }}/env"
virtualenv_python: python2.7
virtualenv_python: "python{{ matrix_synapse_python_version }}"
when: clone_synapse.changed
tags:
- skip_ansible_lint # skip when clause
@ -59,7 +59,7 @@
- name: install synapse with docker
docker_container:
name: synapse
image: "docker.io/matrixdotorg/synapse:{{ matrix_synapse_version }}"
image: "docker.io/matrixdotorg/synapse:{{ matrix_synapse_version }}-py{{ matrix_synapse_python_version }}"
ports: "{{ matrix_synapse_docker_ports }}"
labels: "{{ matrix_synapse_docker_labels }}"
restart_policy: unless-stopped