Commit 030dc8bc authored by Florian Haas's avatar Florian Haas
Browse files

Discover correct Python package prefix

Based on whether the Ansible Python interpreter is Python 2 (the
default on Ubuntu Xenial), or Python 3 (the default on Ubuntu Bionic),
Ansible modules that rely on extra Python modules require either
"python-" or "python3-" Ubuntu packages to function.

Make sure we install the right one.

Note that on any Ubuntu Bionic system that has events or async tasks
enabled, and thus installs RabbitMQ, the Bionic rabbitmq-server
package's dependency on python (that is, the Python 2 interpreter)
will effectively pull Python 2 into that system, and many Ansible
versions will use that interpreter by default, once it is installed.

References:
https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html
https://packages.ubuntu.com/bionic/rabbitmq-server
parent fe712be0
......@@ -25,13 +25,11 @@
- libxml2-dev
- libxslt-dev
- libzmq3-dev
- python-dev
- python-pip
- python3
- python3-dev
- python3-pip
- "{{ _taiga_python_package_prefix }}-virtualenv"
- tmux
- virtualenvwrapper
- zlib1g-dev
tags:
- install
......
......@@ -9,7 +9,7 @@
- postgresql-contrib
- postgresql-doc
- postgresql-server-dev-all
- python-psycopg2
- "{{ _taiga_python_package_prefix }}-psycopg2"
tags:
- install
- back-install
......
......@@ -2,7 +2,7 @@
become: true
become_user: root
apt:
name: python-openssl
name: "{{ _taiga_python_package_prefix }}-openssl"
state: "{{ taiga_upgrade | bool | ternary('latest', 'present') }}"
tags:
- install
......
......@@ -2,7 +2,7 @@
become: true
become_user: root
apt:
name: python-openssl
name: "{{ _taiga_python_package_prefix }}-openssl"
state: "{{ taiga_upgrade | bool | ternary('latest', 'present') }}"
tags:
- install
......
......@@ -6,7 +6,7 @@
state: "{{ taiga_upgrade | bool | ternary('latest', 'present') }}"
with_items:
- circus
- python-setuptools
- "{{ _taiga_python_package_prefix }}-setuptools"
tags:
- install
- front-install
......
......@@ -27,6 +27,13 @@
tags:
- always
- name: set facts related to Python versioning
set_fact:
_taiga_python_major_version: "{{ ansible_python['version']['major'] }}"
_taiga_python_package_prefix: "{{ (ansible_python['version']['major'] == 3) | ternary('python3', 'python') }}"
tags:
- always
- name: set facts identifying node roles
set_fact:
_taiga_is_back_node: "{{ 'taiga-back' in group_names }}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment