Add tox deploy job to validate bootstrap process

When a user tries windmill, they have a multiple options to actually
run ansible. However, we can atleast provide a basic way to bootstrap
a host and validate our playbooks and roles are in working order.

This could also be a simple way to try newer version of ansible, under
zuul gains the ability to support that.

Change-Id: I4e97b0f10437adf7a153148cc7fa5ae45e81d4de
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
changes/09/557109/17
Paul Belanger 5 years ago
parent 549cb217b7
commit bd142ffa4b
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
  1. 19
      .zuul.d/jobs-tox.yaml
  2. 6
      .zuul.d/projects.yaml
  3. 1
      requirements.txt
  4. 5
      tests/extra-vars.yaml
  5. 3
      tests/playbooks/tox/run.yaml
  6. 6
      tools/install_roles.sh
  7. 34
      tox.ini

@ -0,0 +1,19 @@
- job:
name: windmill-tox-deploy
parent: tox
run: tests/playbooks/tox/run.yaml
nodeset: ubuntu-xenial
required-projects:
- openstack/ansible-role-diskimage-builder
- openstack/ansible-role-gearman
- openstack/ansible-role-logrotate
- openstack/ansible-role-nodepool
- openstack/ansible-role-shade
- openstack/ansible-role-ssh
- openstack/ansible-role-sudoers
- openstack/ansible-role-virtualenv
- openstack/ansible-role-zookeeper
- openstack/ansible-role-zuul
vars:
tox_envlist: deploy
tox_extra_args: '-vv -- --extra-vars "@tests/extra-vars.yaml"'

@ -4,3 +4,9 @@
- windmill-jobs-fedora-27
- windmill-jobs-bionic
- windmill-jobs-xenial
check:
jobs:
- windmill-tox-deploy
gate:
jobs:
- windmill-tox-deploy

@ -3,3 +3,4 @@ paramiko<2.0.0
ansible>=2.0.0,<2.4.0
bindep
netaddr

@ -0,0 +1,5 @@
# NOTE(pabelanger): In the gate, we want to create a zuul-test user /
# group as zuul already exists on our images.
zuul_user_name: zuul-test
zuul_user_group: zuul-test
zuul_user_home: /var/lib/zuul

@ -0,0 +1,3 @@
- hosts: all
roles:
- tox

@ -15,4 +15,10 @@
TOOLSDIR=$(dirname $0)
# NOTE(pabelanger): Check if we are running in the gate, if so use cached repos
# to avoid hitting the network.
if [ -f /etc/ci/mirror_info.sh ]; then
sed -e "s|https://|file://${HOME}/src/|g" -i $TOOLSDIR/requirements.yaml
fi
ansible-galaxy install -v -r $TOOLSDIR/requirements.yaml -p playbooks/roles

@ -15,48 +15,18 @@ deps = -r{toxinidir}/requirements.txt
deps = bindep
commands = bindep test
[testenv:buildimages]
deps = -r{toxinidir}/requirements.txt
commands =
{toxinidir}/tools/install_bindep.sh
{toxinidir}/tools/install_roles.sh
# NOTE(pabelanger): Because ansible default ansible_user to null now, we need to pass it via CLI.
ansible-playbook -i playbooks/inventory playbooks/build-images.yaml -e ansible_user={env:USER} {posargs}
passenv =
HOME
SSH_AUTH_SOCK
USER
setenv =
ANSIBLE_CONFIG = {toxinidir}/playbooks/ansible.cfg
PYTHONUNBUFFERED = 1
[testenv:deploy]
deps = -r{toxinidir}/requirements.txt
commands =
{toxinidir}/tools/install_bindep.sh
{toxinidir}/tools/install_roles.sh
# NOTE(pabelanger): Because ansible default ansible_user to null now, we need to pass it via CLI.
ansible-playbook -i inventory/single-node playbooks/site.yaml -e ansible_user={env:USER} {posargs}
passenv =
HOME
SSH_AUTH_SOCK
USER
setenv =
ANSIBLE_CONFIG = {toxinidir}/playbooks/ansible.cfg
PYTHONUNBUFFERED = 1
[testenv:publish-images]
deps = -r{toxinidir}/requirements.txt
commands =
{toxinidir}/tools/install_bindep.sh
{toxinidir}/tools/install_roles.sh
# NOTE(pabelanger): Because ansible default ansible_user to null now, we need to pass it via CLI.
ansible-playbook -i playbooks/inventory playbooks/build-images.yaml -e ansible_user={env:USER} {posargs}
ansible-playbook -i inventory/single-node playbooks/bastion.yaml {posargs}
ansible-playbook -i inventory/single-node playbooks/site.yaml {posargs}
passenv =
HOME
SSH_AUTH_SOCK
USER
WORKSPACE
setenv =
ANSIBLE_CONFIG = {toxinidir}/playbooks/ansible.cfg
PYTHONUNBUFFERED = 1

Loading…
Cancel
Save