2a763c3b4d
Also use ansible 2.11 for tests. Depends-On: https://review.opendev.org/c/openstack/requirements/+/807571 Change-Id: I702596495b098d6950495fda35632d3754da54e7
95 lines
2.8 KiB
YAML
95 lines
2.8 KiB
YAML
---
|
|
- hosts: all
|
|
pre_tasks:
|
|
- name: Set project path fact
|
|
set_fact:
|
|
validations_common_project_path: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/validations-common'].src_dir }}"
|
|
|
|
- name: Ensure output dirs
|
|
file:
|
|
path: "{{ ansible_user_dir }}/zuul-output/logs"
|
|
state: directory
|
|
|
|
- name: Ensure pip is available
|
|
include_role:
|
|
name: ensure-pip
|
|
|
|
- name: Ensure virtualenv is available
|
|
include_role:
|
|
name: ensure-virtualenv
|
|
|
|
- name: Setup bindep
|
|
pip:
|
|
name: "bindep"
|
|
virtualenv: "{{ ansible_user_dir }}/test-python"
|
|
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
|
|
virtualenv_site_packages: true
|
|
|
|
- name: Run bindep
|
|
shell: |-
|
|
. {{ ansible_user_dir }}/test-python/bin/activate
|
|
{{ validations_common_project_path }}/scripts/bindep-install
|
|
become: true
|
|
changed_when: false
|
|
|
|
- name: Ensure a recent version of pip is installed in virtualenv
|
|
pip:
|
|
name: "pip>=19.1.1"
|
|
virtualenv: "{{ ansible_user_dir }}/test-python"
|
|
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
|
|
|
|
- name: Setup test-python
|
|
pip:
|
|
requirements: "{{ validations_common_project_path }}/molecule-requirements.txt"
|
|
virtualenv: "{{ ansible_user_dir }}/test-python"
|
|
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
|
|
virtualenv_site_packages: true
|
|
|
|
- name: Set up collections
|
|
command: "{{ ansible_user_dir }}/test-python/bin/ansible-galaxy install -fr {{ validations_common_project_path }}/ansible-collections-requirements.yml"
|
|
|
|
- name: Display test-python virtualenv package versions
|
|
shell: |-
|
|
. {{ ansible_user_dir }}/test-python/bin/activate
|
|
pip freeze
|
|
|
|
- name: Basic ci setup
|
|
become: true
|
|
block:
|
|
- name: Ensure ci directories
|
|
file:
|
|
path: "/etc/ci"
|
|
state: "directory"
|
|
|
|
- name: Ensure ci mirror file
|
|
file:
|
|
path: "/etc/ci/mirror_info.sh"
|
|
state: "touch"
|
|
|
|
- name: Set an appropriate fs.file-max
|
|
sysctl:
|
|
name: fs.file-max
|
|
value: 2048000
|
|
sysctl_set: true
|
|
state: present
|
|
reload: true
|
|
|
|
- name: Set container_manage_cgroup boolean
|
|
seboolean:
|
|
name: container_manage_cgroup
|
|
state: true
|
|
persistent: true
|
|
failed_when: false
|
|
|
|
- name: Create limits file for containers
|
|
copy:
|
|
content: |
|
|
* soft nofile 102400
|
|
* hard nofile 204800
|
|
* soft nproc 2048
|
|
* hard nproc 4096
|
|
dest: /etc/security/limits.d/containers.conf
|
|
|
|
- name: Reset ssh connection
|
|
meta: reset_connection
|