Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add base-test playbooks and test-prepare-workspace role #18

Merged
merged 1 commit into from May 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions playbooks/base-test/post.yaml
@@ -0,0 +1,22 @@
---
- hosts: localhost
roles:
- role: add-fileserver
fileserver: "{{ site_ansiblelogs }}"
- emit-ara-html

- hosts: "{{ site_ansiblelogs.fqdn }}"
tasks:
# Use a block because play vars doesn't take precedence on roles vars
- block:
- import_role: name=upload-logs
vars:
zuul_log_url: "{{ site_ansiblelogs.url }}"
zuul_logserver_root: "{{ site_ansiblelogs.path }}"

- hosts: localhost
ignore_errors: yes
roles:
- role: submit-logstash-jobs
logstash_gearman_server: "ansible.softwarefactory-project.io"
logstash_gearman_server_port: 4731
5 changes: 5 additions & 0 deletions playbooks/base-test/pre.yaml
@@ -0,0 +1,5 @@
---
- hosts: all
roles:
- test-prepare-workspace
- role: validate-host
7 changes: 7 additions & 0 deletions roles/test-prepare-workspace/README.rst
@@ -0,0 +1,7 @@
Prepare remote workspaces

This role is intended to run before any other role in a Zuul job.

It starts the Zuul console streamer on every host in the inventory,
and then copies the prepared source repos to the working directory on
every host.
1 change: 1 addition & 0 deletions roles/test-prepare-workspace/defaults/main.yaml
@@ -0,0 +1 @@
zuul_workspace_root: .
11 changes: 11 additions & 0 deletions roles/test-prepare-workspace/tasks/main.yaml
@@ -0,0 +1,11 @@
# TODO(pabelanger): Handle cleanup on static nodes
- name: Start zuul_console daemon.
zuul_console:
tags:
# Avoid "no action detected in task" linter error
- skip_ansible_lint

- name: Synchronize src repos to workspace directory.
synchronize:
dest: "{{ zuul_workspace_root }}"
src: "{{ zuul.executor.src_root }}"
1 change: 1 addition & 0 deletions zuul.d/jobs.yaml
Expand Up @@ -49,6 +49,7 @@
post-run:
- playbooks/base-test/post.yaml
roles:
- zuul: ansible-network/ansible-zuul-jobs
- zuul: sf-jobs
- zuul: openstack-infra/zuul-jobs
timeout: 1800
Expand Down