From 22befecd1f06150f6cd846a45b58d19b57677f78 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Wed, 4 Oct 2017 10:29:24 -0400 Subject: [PATCH] Initial support for zuulv3 Now that zuulv3 is live, we can start having in repo jobs. Change-Id: I0463d440abac26b4592fce0e26960be33c0a4efc Depends-On: I7db3518f6dbd9c9315ebb5d4c40c6e18764b4e94 Depends-On: I3bff01ebac17c40988df60e7e4dd6e7fdc88a896 Signed-off-by: Paul Belanger --- .zuul.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ tests/ansible.cfg | 2 -- tests/inventory | 1 - tests/test.yaml | 15 +++++---------- tox.ini | 2 +- 5 files changed, 47 insertions(+), 14 deletions(-) create mode 100644 .zuul.yaml delete mode 100644 tests/ansible.cfg diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 0000000..9142bcd --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,41 @@ +- job: + name: ansible-role-nodepool + run: tests/test + required-projects: + - name: openstack-infra/nodepool + override-branch: feature/zuulv3 + roles: + - zuul: openstack/ansible-role-nodepool + +- job: + name: ansible-role-nodepool-centos-7 + parent: ansible-role-nodepool + nodeset: centos-7 + +- job: + name: ansible-role-nodepool-fedora-26 + parent: ansible-role-nodepool + nodeset: fedora-26 + +- job: + name: ansible-role-nodepool-ubuntu-xenial + parent: ansible-role-nodepool + nodeset: ubuntu-xenial + +- project: + name: openstack/ansible-role-nodepool + templates: + - windmill-jobs-fedora-26 + - windmill-jobs-xenial + check: + jobs: + - ansible-role-nodepool-centos-7 + - ansible-role-nodepool-fedora-26 + - ansible-role-nodepool-ubuntu-xenial + - tox-linters + gate: + jobs: + - ansible-role-nodepool-centos-7 + - ansible-role-nodepool-fedora-26 + - ansible-role-nodepool-ubuntu-xenial + - tox-linters diff --git a/tests/ansible.cfg b/tests/ansible.cfg deleted file mode 100644 index 6c8a344..0000000 --- a/tests/ansible.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[defaults] -roles_path = ../.. diff --git a/tests/inventory b/tests/inventory index 68b2dac..2fbb50c 100644 --- a/tests/inventory +++ b/tests/inventory @@ -1,2 +1 @@ -[all] localhost diff --git a/tests/test.yaml b/tests/test.yaml index 3f6393d..06decce 100644 --- a/tests/test.yaml +++ b/tests/test.yaml @@ -12,16 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. --- -- hosts: localhost +- hosts: all vars: - rolename: "{{ lookup('pipe', 'pwd') | dirname | basename }}" - 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' + nodepool_git_dest: "{{ ansible_user_dir }}/src/git.openstack.org/openstack-infra/nodepool" + nodepool_git_update: false + rolename: ansible-role-nodepool roles: - "{{ rolename }}" @@ -142,7 +137,7 @@ - name: Register nodepool_git_dest_stat. stat: - path: /opt/ansible-role-nodepool/git/openstack-infra/nodepool + path: /home/zuul/src/git.openstack.org/openstack-infra/nodepool register: nodepool_git_dest_stat - name: Assert nodepool_git_dest tests. diff --git a/tox.ini b/tox.ini index 60b7f91..e56c12f 100644 --- a/tox.ini +++ b/tox.ini @@ -34,7 +34,7 @@ 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