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>
This commit is contained in:
parent
549cb217b7
commit
bd142ffa4b
|
@ -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-fedora-27
|
||||||
- windmill-jobs-bionic
|
- windmill-jobs-bionic
|
||||||
- windmill-jobs-xenial
|
- 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
|
ansible>=2.0.0,<2.4.0
|
||||||
bindep
|
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)
|
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
|
ansible-galaxy install -v -r $TOOLSDIR/requirements.yaml -p playbooks/roles
|
||||||
|
|
34
tox.ini
34
tox.ini
|
@ -15,28 +15,14 @@ deps = -r{toxinidir}/requirements.txt
|
||||||
deps = bindep
|
deps = bindep
|
||||||
commands = bindep test
|
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]
|
[testenv:deploy]
|
||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
commands =
|
commands =
|
||||||
{toxinidir}/tools/install_bindep.sh
|
{toxinidir}/tools/install_bindep.sh
|
||||||
{toxinidir}/tools/install_roles.sh
|
{toxinidir}/tools/install_roles.sh
|
||||||
# NOTE(pabelanger): Because ansible default ansible_user to null now, we need to pass it via CLI.
|
# 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}
|
ansible-playbook -i inventory/single-node playbooks/bastion.yaml {posargs}
|
||||||
|
ansible-playbook -i inventory/single-node playbooks/site.yaml {posargs}
|
||||||
passenv =
|
passenv =
|
||||||
HOME
|
HOME
|
||||||
SSH_AUTH_SOCK
|
SSH_AUTH_SOCK
|
||||||
|
@ -45,22 +31,6 @@ setenv =
|
||||||
ANSIBLE_CONFIG = {toxinidir}/playbooks/ansible.cfg
|
ANSIBLE_CONFIG = {toxinidir}/playbooks/ansible.cfg
|
||||||
PYTHONUNBUFFERED = 1
|
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}
|
|
||||||
passenv =
|
|
||||||
HOME
|
|
||||||
SSH_AUTH_SOCK
|
|
||||||
USER
|
|
||||||
WORKSPACE
|
|
||||||
setenv =
|
|
||||||
ANSIBLE_CONFIG = {toxinidir}/playbooks/ansible.cfg
|
|
||||||
PYTHONUNBUFFERED = 1
|
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
commands = python setup.py build_sphinx
|
commands = python setup.py build_sphinx
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue