Updated to use the openstack-ansible-tests repo

This change moves the role run and pre-steps to the tests
repo.

Depends-On: Ib2ec8840966aea574fef7387cee2ffabd597b4cb
Change-Id: Ib27bc814b14e3584450423d6a7f0e6842fd3fd98
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2016-08-24 19:16:45 -05:00
parent 9e4d02665f
commit ee409f4aac
No known key found for this signature in database
GPG Key ID: 69FEFFC5E2D9273F
4 changed files with 28 additions and 12 deletions

3
.gitignore vendored
View File

@ -61,3 +61,6 @@ releasenotes/build
# Vagrant testing artifacts
.vagrant
# Test playbooks brought in by tox
tests/playbooks

17
tests/group_vars/all.yml Normal file
View File

@ -0,0 +1,17 @@
---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
global_environment_variables:
PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

View File

@ -13,21 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include: "playbooks/test-install-openstack-hosts.yml"
- name: Playbook for role testing
hosts: localhost
connection: local
gather_facts: true
pre_tasks:
- name: First ensure apt cache is always refreshed
apt:
update_cache: yes
when:
- ansible_pkg_mgr == 'apt'
roles:
- role: "{{ rolename | basename }}"
global_environment_variables:
PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
post_tasks:
tasks:
- name: Open modules file
slurp:
src: /etc/modules

View File

@ -120,7 +120,11 @@ commands =
ansible-galaxy install \
--role-file={toxinidir}/tests/ansible-role-requirements.yml \
--force
rm -rf {homedir}/.ansible/roles/openstack_hosts
bash -c "ln -s {toxinidir} {homedir}/.ansible/roles/openstack_hosts"
rm -rf {toxinidir}/tests/playbooks
git clone https://git.openstack.org/openstack/openstack-ansible-tests \
{toxinidir}/tests/playbooks
[testenv:ansible-syntax]
deps =