tripleo-ansible/zuul.d/playbooks/pre.yml
Kevin Carter bc9fe7f827
Create tripleo container image prepare role
This change creates a role for  the tripleo heat template content for
"container-image-prepare-baremetal-ansible.j2.yaml". This change will
ensure our task process is tested using molecule and scenario tests
while also streamlining our process.

Test Matrix:
  - default - tests role using all default options
  - build - tests end to end building containers using mock data

A new playbook for docker vfs setup has been added. This was added to
allow some tests to run docker workloads within a local filesystem.
Without this change, docker workloads would fail because docker is
not able to run an overlayfs job from within an overlayfs
environment. This new playbook will be used within our zuul jobs
whenever the variable `docker_enable_vfs`, is set to "true".

Change-Id: Ic6e26eb95734ccf17e42e649b5e5808e1a096a78
Story: 2005985
Task: 34438
Task: 34440
Task: 34441
Signed-off-by: Kevin Carter <kecarter@redhat.com>
2019-08-13 19:02:07 -05:00

64 lines
2.2 KiB
YAML

---
- hosts: all
pre_tasks:
- name: Set project path fact
set_fact:
tripleo_ansible_project_path: "{{ ansible_user_dir }}/{{ zuul.project.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"
- "/usr/share/ansible/tripleo-plugins/action"
- name: Ensure output dirs
file:
path: "{{ ansible_user_dir }}/zuul-output/logs"
state: directory
- name: Setup bindep
pip:
name: "bindep"
virtualenv: "{{ ansible_user_dir }}/test-python"
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_site_packages: true
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"
roles:
- role: install-docker
post_tasks:
- name: Run docker vfs setup
shell: |-
. {{ ansible_user_dir }}/test-python/bin/activate
. {{ tripleo_ansible_project_path }}/ansible-test-env.rc
ansible-playbook -i 'localhost,' \
-e tripleo_docker_enable_vfs={{ tripleo_docker_enable_vfs }} \
docker-vfs-setup.yml
args:
chdir: "{{ tripleo_ansible_project_path }}/tripleo_ansible/playbooks"
executable: /bin/bash
environment:
ANSIBLE_ACTION_PLUGINS: "{{ tripleo_action_plugins_paths | join(':') }}"
when:
- tripleo_docker_enable_vfs is defined