Browse Source

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>
changes/35/569435/5
Paul Belanger 4 years ago
parent
commit
2959772d57
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
  1. 39
      .zuul.yaml
  2. 12
      meta/main.yml
  3. 2
      requirements.txt
  4. 2
      tests/ansible.cfg
  5. 3
      tests/inventory
  6. 15
      tests/playbooks/run.yaml
  7. 35
      tox.ini

39
.zuul.yaml

@ -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

12
meta/main.yml

@ -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: []

2
requirements.txt

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

2
tests/ansible.cfg

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

3
tests/inventory

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

15
tests/test.yaml → tests/playbooks/run.yaml

@ -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 }}"

35
tox.ini

@ -10,37 +10,28 @@ 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:venv]
commands = {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
[testenv:linters]
setenv =
ANSIBLE_CONFIG = tests/ansible.cfg
ANSIBLE_ROLES_PATH = ..
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"
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"
[testenv:venv]
commands = {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
show-source = True
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build

Loading…
Cancel
Save