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

Define reusable molecule jobs #311

Merged
merged 1 commit into from Jan 22, 2020
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
15 changes: 15 additions & 0 deletions playbooks/ansible-tox-molecule/pre.yaml
@@ -1,5 +1,20 @@
---
- hosts: all
tasks:

- name: Reset SSH connection for new group
meta: reset_connection

# TODO(ssbarnea): remove hack once upstream patch merges:
# https://review.opendev.org/#/c/703053/
- name: Workaround for yum --nobest with docker-ce
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "8"
become: true
yum:
name: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm
Comment on lines +10 to +16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see us link to some sort of upstream issue around this, as we likely should fix this in the install-docker role.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- name: Install docker
include_role:
name: install-docker
59 changes: 57 additions & 2 deletions zuul.d/jobs.yaml
Expand Up @@ -22,10 +22,26 @@
nodeset: centos-8-1vcpu

- job:
name: ansible-tox-molecule
parent: tox-molecule
name: ansible-tox-docs
ssbarnea marked this conversation as resolved.
Show resolved Hide resolved
parent: tox-docs
nodeset: centos-8-1vcpu

- job: &ansible-tox-molecule-base
name: ansible-tox-molecule-base
# Stub job used to define only properties specific to molecule jobs,
# expected to decorate other job definitions via anchors. To avoid overrides
# it does *not* have: nodeset, abstract, description
pre-run: playbooks/ansible-tox-molecule/pre.yaml
post-run: playbooks/ansible-tox-molecule/post.yaml
timeout: 5400 # 1.5h as they are expected to be slower by nature

- job:
<<: *ansible-tox-molecule-base
name: ansible-tox-molecule
description: |
Generic molecule jobs that does not specify which python version will
be using, recommended when that is not important.
ssbarnea marked this conversation as resolved.
Show resolved Hide resolved
parent: tox-molecule
vars:
tox_envlist: molecule
nodeset: fedora-latest-1vcpu
Expand Down Expand Up @@ -592,3 +608,42 @@
nodeset: vyos-1.1.8-python38
vars:
ansible_test_python: 3.8

# molecule- prefixed jobs match ansible- ones but also enable extra
# virtualization services that are use by molecule, like docker, podman (TBD)
# or libvirt (TBD).

- job:
<<: *ansible-tox-molecule-base
name: molecule-tox-linters
parent: ansible-tox-linters

- job:
<<: *ansible-tox-molecule-base
name: molecule-tox-docs
parent: ansible-tox-docs

- job:
<<: *ansible-tox-molecule-base
name: molecule-tox-py27
parent: ansible-tox-py27

- job:
<<: *ansible-tox-molecule-base
name: molecule-tox-py35
parent: ansible-tox-py35

- job:
<<: *ansible-tox-molecule-base
name: molecule-tox-py36
parent: ansible-tox-py36

- job:
<<: *ansible-tox-molecule-base
name: molecule-tox-py37
parent: ansible-tox-py37

- job:
<<: *ansible-tox-molecule-base
name: molecule-tox-py38
parent: ansible-tox-py38