Updates for zuulv3 jobs

Since migrating from zuulv2.5 our jobs were still legacy. This updates
the required bits again to get our jobs properly passing again.

Change-Id: Iba333fd2d8dc996e7eea63494478640d133c9da6
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2018-05-18 10:48:46 -04:00
parent 1d1636db02
commit 2959772d57
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
7 changed files with 66 additions and 44 deletions

39
.zuul.yaml Normal file
View File

@ -0,0 +1,39 @@
- job:
name: ansible-role-ssh
run: tests/playbooks/run.yaml
roles:
- zuul: openstack/ansible-role-ssh
- job:
name: ansible-role-ssh-fedora-27
parent: ansible-role-ssh
nodeset: fedora-27
- job:
name: ansible-role-ssh-ubuntu-bionic
parent: ansible-role-ssh
nodeset: ubuntu-bionic
- job:
name: ansible-role-ssh-ubuntu-xenial
parent: ansible-role-ssh
nodeset: ubuntu-xenial
- project:
name: openstack/ansible-role-ssh
templates:
- windmill-jobs-fedora-27
- windmill-jobs-bionic
- windmill-jobs-xenial
check:
jobs:
- ansible-role-ssh-fedora-27
- ansible-role-ssh-ubuntu-bionic
- ansible-role-ssh-ubuntu-xenial
- tox-linters
gate:
jobs:
- ansible-role-ssh-fedora-27
- ansible-role-ssh-ubuntu-bionic
- ansible-role-ssh-ubuntu-xenial
- tox-linters

View File

@ -20,11 +20,15 @@ galaxy_info:
unsecured network.
company: Red Hat, Inc.
license: Apache
min_ansible_version: 2.0
min_ansible_version: 2.4
platforms:
- name: EL
- name: Fedora
versions:
- 7
- 27
- name: Ubuntu
versions:
- 16.04
- 18.04
categories:
- cloud
- system
dependencies: []

View File

@ -1 +1 @@
ansible>=2.0.0
ansible>=2.4.0

View File

@ -1,2 +0,0 @@
[defaults]
roles_path = ../..

View File

@ -1,2 +1 @@
[test]
test01 ansible_host=127.0.0.2
localhost

View File

@ -1,4 +1,4 @@
# Copyright 2015 Red Hat, Inc.
# Copyright 2018 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -12,20 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
---
- hosts: test
- hosts: all
vars:
rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}"
rolename: ansible-role-ssh
ssh_user_name: "{{ ansible_user }}"
ssh_user_home: /tmp/.ssh
pre_tasks:
# Make sure OS does not have a stale package cache.
- name: Update apt cache.
become: yes
apt:
update_cache: yes
when: ansible_os_family == 'Debian'
roles:
- "{{ rolename }}"

37
tox.ini
View File

@ -10,29 +10,6 @@ deps = -r{toxinidir}/requirements.txt
[testenv:docs]
commands = python setup.py build_sphinx
[testenv:functional]
commands =
ansible-playbook -i tests/inventory tests/test.yaml -e ansible_user={env:USER}
passenv = HOME
setenv =
ANSIBLE_CONFIG = {toxinidir}/tests/ansible.cfg
PYTHONUNBUFFERED = 1
[testenv:linters]
setenv =
ANSIBLE_CONFIG = tests/ansible.cfg
whitelist_externals = bash
commands =
# PEP8 Lint Check
flake8
# Ansible Lint Check
bash -c "find . -type f -regex '.*.y[a]?ml' -print0 | xargs -t -n1 -0 \
ansible-lint"
# Ansible Syntax Check
bash -c "find tests -type f -regex '.*.y[a]?ml' -print | xargs -t -n1 \
ansible-playbook --syntax-check -i tests/inventory \
-e rolename=$(basename $(pwd)) > /dev/null"
[testenv:venv]
commands = {posargs}
@ -44,3 +21,17 @@ ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
[testenv:linters]
setenv =
ANSIBLE_ROLES_PATH = ..
whitelist_externals = bash
commands =
# PEP8 Lint Check
flake8
# Ansible Lint Check
bash -c "find . -not -path '*/\.*' -type f -regex '.*.y[a]?ml' -print0 | \
xargs -t -n1 -0 ansible-lint"
# Ansible Syntax Check
bash -c "find tests -type f -regex '.*.y[a]?ml' -print | xargs -t -n1 \
ansible-playbook --syntax-check -i tests/inventory \
-e rolename=$(basename $(pwd)) > /dev/null"