kolla-ansible/tests/pre.yml
Michal Nasiadka f3ba8d5f23 Run tox in venv in case of building images
tox depends on virtualenv, when it's installed using pip - it tries to upgrade
virtualenv, and then fails.

Change-Id: Ic9566778f87f8b81563ed012e651cef50d1baa38
2020-06-24 17:54:26 +02:00

74 lines
1.7 KiB
YAML

---
- hosts: all
vars:
logs_dir: "/tmp/logs"
roles:
- bindep
- multi-node-firewall
tasks:
- name: Install dbus for debian system
apt: name=dbus
when:
- ansible_os_family == 'Debian'
become: true
- block:
# NOTE(mgoddard): The CentOS image used in CI has epel-release installed,
# but the configure-mirrors role used by Zuul disables epel. Since we
# install epel-release and expect epel to be enabled, enable it here.
- name: Ensure yum-utils is installed
package:
name: yum-utils
state: present
- name: Enable the EPEL repository
command: yum-config-manager --enable epel
become: true
when:
- ansible_os_family == "RedHat"
- name: Install Python2 modules
become: true
package:
name:
- python-pip
- python-setuptools
- python-virtualenv
- python-wheel
- name: Install virtualenv on Debian systems
package:
name:
- virtualenv
become: true
when:
ansible_os_family == "Debian"
- name: Ensure latest pip is installed
become: true
pip:
name: pip
state: latest
- name: Ensure /tmp/logs/ dir
file:
path: "{{ logs_dir }}"
state: "directory"
- name: Ensure node directories
file:
path: "{{ logs_dir }}/{{ item }}"
state: "directory"
mode: 0777
with_items:
- "docker_logs"
- "kolla_configs"
- "system_logs"
- "kolla"
- "ansible"
- name: set new hostname based on ansible inventory file
hostname:
name: "{{ inventory_hostname }}"
become: true