add zuul jobs

Change-Id: Ic97611b8658a14d6fd17641f4a734e7c5c15e720
This commit is contained in:
Mohammed Naser 2019-04-10 18:56:29 -04:00
parent f0026cf9bf
commit ec44d25f9b
6 changed files with 135 additions and 2 deletions

11
tests/post-run.yaml Normal file
View File

@ -0,0 +1,11 @@
---
- hosts: all
become: true
tasks:
- name: Extract journal contents
shell: journalctl > journal.log
- name: Copy journal log to executor
fetch:
src: journal.log
dest: "{{ zuul.executor.log_root }}"

60
tests/run.yaml Normal file
View File

@ -0,0 +1,60 @@
---
- hosts: all
become: true
tasks:
- name: Flush firewall rules
iptables:
flush: true
# NOTE(mnaser): Wireguard on CentOS requires EPEL, this role does not
# manage it for you.
- name: Enable EPEL
yum_repository:
name: epel
description: Extra Packages for Enterprise Linux 7 - $basearch
baseurl: "http://{{ zuul_site_mirror_fqdn }}/epel/7/$basearch"
enabled: true
when: ansible_os_family == 'RedHat'
# NOTE(mnaser): Glean interferes with the interfaces, disable for now
# Drop when https://review.openstack.org/651680 lands.
- name: Disable Glean
file:
path: /etc/udev/rules.d/99-glean.rules
state: absent
- hosts: primary
roles:
- wireguard
vars:
wireguard_links:
- name: wg0
address: 10.0.0.1
port: 51820
private_key: eCpvWOe8zI0HCj/KjK3TZP71kd+glDxvDo5JaQhw3mw=
peers:
- public_key: UB9Lhk0JgwAPFD8F3k3Dq9iS7r/jLD+oYMX98T+fmGw=
endpoint: "{{ hostvars['secondary']['ansible_host'] }}:51820"
allowed_ips: 10.0.0.2
- hosts: secondary
roles:
- wireguard
vars:
wireguard_links:
- name: wg0
address: 10.0.0.2
port: 51820
private_key: aIPcdRd6ncwRa+DJLaiq0Jmbvx1FjtLnWE2EApgcr2E=
peers:
- public_key: E/MU5hNb1mQ55ww0H0luxigNTXNNo/x49MRm5AcHLSI=
endpoint: "{{ hostvars['primary']['ansible_host'] }}:51820"
allowed_ips: 10.0.0.1
- hosts: primary
tasks:
- name: Check if primary can reach secondary
shell: ping -c4 -W 1 10.0.0.2
- hosts: secondary
tasks:
- name: Check if secondary can reach primary
shell: ping -c4 -W 1 10.0.0.1

View File

@ -1,3 +1,4 @@
---
wireguard_packages:
- "linux-headers-{{ ansible_kernel }}"
- wireguard

30
zuul.d/jobs.yaml Normal file
View File

@ -0,0 +1,30 @@
# Copyright 2019, VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- job:
name: ansible-role-wireguard-integration
parent: base
abstract: true
run: tests/run.yaml
post-run: tests/post-run.yaml
- job:
name: ansible-role-wireguard-integration-centos-7
parent: ansible-role-wireguard-integration
nodeset: centos-7-2-node
- job:
name: ansible-role-wireguard-integration-ubuntu-bionic
parent: ansible-role-wireguard-integration
nodeset: ubuntu-bionic-2-node

29
zuul.d/nodesets.yaml Normal file
View File

@ -0,0 +1,29 @@
# Copyright 2019, VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- nodeset:
name: centos-7-2-node
nodes:
- name: primary
label: centos-7
- name: secondary
label: centos-7
- nodeset:
name: ubuntu-bionic-2-node
nodes:
- name: primary
label: ubuntu-bionic
- name: secondary
label: ubuntu-bionic

View File

@ -15,7 +15,9 @@
- project:
check:
jobs:
- noop
- ansible-role-wireguard-integration-centos-7
- ansible-role-wireguard-integration-ubuntu-bionic
gate:
jobs:
- noop
- ansible-role-wireguard-integration-centos-7
- ansible-role-wireguard-integration-ubuntu-bionic