tripleo-ansible/zuul.d/playbooks/pre.yml
Alex Schultz 19ef86c627 Ensure pip is installed
We need pip and virtualenv for molcule jobs. This was dropped recently
in the base image so we need to handle this ourselves.

Change-Id: Ie5ba86c4d8aa97959d7336886536dc1439ce54bd
2020-06-17 13:48:30 -06:00

97 lines
2.9 KiB
YAML

---
- hosts: all
pre_tasks:
- name: Set project path fact
set_fact:
tripleo_ansible_project_path: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-ansible'].src_dir }}"
- name: Set action plugin path fact
set_fact:
tripleo_action_plugins_paths:
- "{{ tripleo_ansible_project_path }}/tripleo_ansible/roles.galaxy/config_template/action"
- "{{ tripleo_ansible_project_path }}/tripleo_ansible/ansible_plugins/action"
- "/usr/share/ansible/plugins/action"
- 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: 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
{{ tripleo_ansible_project_path }}/scripts/bindep-install
become: true
- name: Setup test-python
pip:
requirements: "{{ tripleo_ansible_project_path }}/molecule-requirements.txt"
virtualenv: "{{ ansible_user_dir }}/test-python"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
virtualenv_site_packages: true
- 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
tasks:
- name: Get Ansible Galaxy roles
command: >-
{{ ansible_user_dir }}/test-python/bin/ansible-galaxy install
-fr
{{ tripleo_ansible_project_path }}/tripleo_ansible/ansible-role-requirements.yml
environment:
ANSIBLE_ROLES_PATH: "{{ tripleo_ansible_project_path }}/tripleo_ansible/roles.galaxy"