tripleo-ci/roles/oooci-build-images/tasks/pre.yaml

86 lines
2.1 KiB
YAML

---
- name: Get python_v fact for py2 or py3 common vars
include_tasks: check_set_py3.yaml
- name: Make sure workspace exists
file:
path: '{{ workspace }}'
state: directory
- name: Install pip with ensure-pip role
include_role:
name: ensure-pip
- name: Install pyyaml from epel
yum:
name: "python36-PyYAML"
enablerepo: epel
state: present
become: true
when: ansible_distribution_major_version|int == 7
- name: Install PyYAML
package:
name: "python3-pyyaml"
state: present
become: true
when: ansible_distribution_major_version|int >= 8
- name: Install python3-devel with provides pathfix.py
package:
name: python3-devel
state: present
become: true
- name: Create a script that fixes shebang for python3
template:
src: pathfix_repos.sh.j2
dest: "{{ workspace }}/pathfix_repos.sh"
mode: u=rwx
- name: Fix shebang path for python3
command: bash {{ workspace }}/pathfix_repos.sh
changed_when: true
- name: Install python3-setuptools
package:
name: "python3-setuptools"
state: present
become: true
when: python_v == "py3"
- name: Install python-setuptools
package:
name: "python-setuptools"
state: present
become: true
when: python_v == "py2"
- name: Ensure a recent version of pip is installed
pip:
extra_args: '--upgrade'
name: "pip>=19.1.1"
virtualenv: "{{ workspace }}/venv"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
- name: Install deps from upper-constraints
when: ansible_distribution == 'CentOS'
pip:
extra_args: "--upgrade -c {{ openstack_git_root }}/requirements/upper-constraints.txt"
requirements: "{{ openstack_git_root }}/{{ item }}/requirements.txt"
virtualenv: "{{ workspace }}/venv"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
with_items:
- diskimage-builder
- tripleo-common
- tripleo-ansible
- python-tripleoclient
- name: pip install tripleo items
pip:
name: "{{ tripleo_pip_projects }}"
extra_args: "--upgrade"
state: present
virtualenv: "{{ workspace }}/venv"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"