Merge "Fix tripleo-repos cross-platform installation"
This commit is contained in:
commit
687a74118f
|
@ -10,18 +10,16 @@ virtualenv_python:
|
|||
yum: python
|
||||
dnf: python3
|
||||
|
||||
python_pip:
|
||||
yum: python-pip
|
||||
dnf: python3-pip
|
||||
|
||||
python_setuptools:
|
||||
yum: python-setuptools
|
||||
dnf: python3-setuptools
|
||||
|
||||
python_virtualenv:
|
||||
yum: python-virtualenv
|
||||
dnf: python3-virtualenv
|
||||
|
||||
python_libselinux:
|
||||
yum: libselinux-python
|
||||
dnf: python3-libselinux
|
||||
rpm_packages:
|
||||
yum:
|
||||
# we have special handling to provide pip on py27 systems
|
||||
- git
|
||||
- libselinux-python
|
||||
- python-setuptools
|
||||
- python-virtualenv
|
||||
dnf:
|
||||
- git
|
||||
- python3-libselinux
|
||||
- python3-pip
|
||||
- python3-setuptools
|
||||
- python3-virtualenv
|
||||
|
|
|
@ -2,20 +2,41 @@
|
|||
- name: install system packages
|
||||
become: true
|
||||
package:
|
||||
name:
|
||||
- "git"
|
||||
- "{{ python_libselinux[ansible_pkg_mgr] }}"
|
||||
- "{{ python_setuptools[ansible_pkg_mgr] }}"
|
||||
- "{{ python_virtualenv[ansible_pkg_mgr] }}"
|
||||
- "{{ python_pip[ansible_pkg_mgr] }}"
|
||||
name: "{{ rpm_packages[ansible_pkg_mgr] }}"
|
||||
state: present
|
||||
|
||||
- name: install pip from epel on centos-7
|
||||
when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == 7
|
||||
block:
|
||||
- name: install epel if needed
|
||||
become: true
|
||||
package:
|
||||
name: epel-release
|
||||
|
||||
- name: install pip on py27 distros
|
||||
shell: yum install -y --disableexcludes='*' /usr/bin/pip
|
||||
register: result
|
||||
changed_when: "'Nothing to do' not in result.stdout"
|
||||
args:
|
||||
warn: false
|
||||
|
||||
# TODO(ssbarnea) workaround for https://bugs.launchpad.net/tripleo/+bug/1821575
|
||||
# virtualenv-3 is missing in infra prepared images but any version should do
|
||||
- name: detect virtualenv command to use
|
||||
shell: command -v virtualenv-3 || command -v virtualenv
|
||||
args:
|
||||
warn: false
|
||||
changed_when: false
|
||||
register: venv_cmd
|
||||
|
||||
- name: pip install tripleo-repos
|
||||
become: true
|
||||
pip:
|
||||
name: "{{ tripleo_repos_repository }}"
|
||||
virtualenv: "{{ workspace }}/venv"
|
||||
virtualenv_python: "{{ virtualenv_python[ansible_pkg_mgr] }}"
|
||||
# https://github.com/ansible/ansible/issues/52275
|
||||
virtualenv_command: "{{ venv_cmd.stdout_lines|first }}"
|
||||
virtualenv_site_packages: true
|
||||
|
||||
- name: Set branch for building containers check jobs
|
||||
|
|
Loading…
Reference in New Issue