Added role requirements file to the tests repo

This change adds the ansible-role-requirements file to the tests
repo based on data provided by OpenStack project-config. To build
the file a script has been produced that will extract our roles
from project-config and insert them into a standard
ansible-role-requirements format.

Change-Id: I6c4c624f9ff8545726846b9e1a25adf03bbae1d0
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2016-08-29 14:53:42 -05:00 committed by Jesse Pretorius (odyssey4me)
parent 48e8e30a8b
commit 9112e2fdf5
2 changed files with 238 additions and 0 deletions

View File

@ -0,0 +1,69 @@
#!/usr/bin/env bash
# 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.
# Simple script to generate a new ansible role requirements file.
BRANCH="${BRANCH:-master}"
CURRENT_DIR="$(pwd)"
WORKSPACE=${WORKSPACE:-$(mktmp --directory)}
function role_entry {
cat >> "${CURRENT_DIR}/ansible-role-requirements.yaml" <<EOF
- name: "$1"
src: "$2"
scm: git
version: "${BRANCH}"
EOF
}
# Create a workspace and clone project-config
mkdir -p "${WORKSPACE}"
git clone https://github.com/openstack-infra/project-config "${WORKSPACE}/project-config"
# Move into the project-config workspace
pushd "${WORKSPACE}/project-config"
# Store information about all of our known repos
PROJECTS=$(python <<EOR
import yaml
with open('gerrit/projects.yaml') as f:
projects = yaml.load(f.read())
for project in projects:
if project['project'].startswith('openstack/openstack-ansible'):
project_name = project['project'].split('/')[-1].split('openstack-ansible-')[-1]
project_github = 'https://git.openstack.org/%s' % project['project']
print('%s|%s' % (project_name, project_github))
EOR
)
# If an existing role requirements file exists it'll be removed.
echo '---' > "${CURRENT_DIR}/ansible-role-requirements.yaml"
# Generate the ansible role requirements file.
for project in ${PROJECTS}; do
git clone ${project#*'|'} "${WORKSPACE}/${project%%'|'*}"
pushd "${WORKSPACE}/${project%%'|'*}"
git fetch --all
git checkout "${BRANCH}"
popd
if [[ -f "${WORKSPACE}/${project%%'|'*}/meta/main.yml" ]];then
role_entry "${project%%'|'*}" "${project#*'|'}"
fi
done
popd
# Cleanup the workspace directory if "true"
[[ "${WORKSPACE_CLEANUP:-true}" = true ]] && rm -rf "${WORKSPACE}"

View File

@ -0,0 +1,169 @@
---
- name: "apt_package_pinning"
src: "https://github.com/openstack/openstack-ansible-apt_package_pinning"
scm: git
version: "master"
- name: "ceph_client"
src: "https://github.com/openstack/openstack-ansible-ceph_client"
scm: git
version: "master"
- name: "galera_client"
src: "https://github.com/openstack/openstack-ansible-galera_client"
scm: git
version: "master"
- name: "galera_server"
src: "https://github.com/openstack/openstack-ansible-galera_server"
scm: git
version: "master"
- name: "haproxy_server"
src: "https://github.com/openstack/openstack-ansible-haproxy_server"
scm: git
version: "master"
- name: "lxc_container_create"
src: "https://github.com/openstack/openstack-ansible-lxc_container_create"
scm: git
version: "master"
- name: "lxc_hosts"
src: "https://github.com/openstack/openstack-ansible-lxc_hosts"
scm: git
version: "master"
- name: "memcached_server"
src: "https://github.com/openstack/openstack-ansible-memcached_server"
scm: git
version: "master"
- name: "openstack_hosts"
src: "https://github.com/openstack/openstack-ansible-openstack_hosts"
scm: git
version: "master"
- name: "openstack_openrc"
src: "https://github.com/openstack/openstack-ansible-openstack_openrc"
scm: git
version: "master"
- name: "os_aodh"
src: "https://github.com/openstack/openstack-ansible-os_aodh"
scm: git
version: "master"
- name: "os_barbican"
src: "https://github.com/openstack/openstack-ansible-os_barbican"
scm: git
version: "master"
- name: "os_ceilometer"
src: "https://github.com/openstack/openstack-ansible-os_ceilometer"
scm: git
version: "master"
- name: "os_cinder"
src: "https://github.com/openstack/openstack-ansible-os_cinder"
scm: git
version: "master"
- name: "os_cloudkitty"
src: "https://github.com/openstack/openstack-ansible-os_cloudkitty"
scm: git
version: "master"
- name: "os_designate"
src: "https://github.com/openstack/openstack-ansible-os_designate"
scm: git
version: "master"
- name: "os_glance"
src: "https://github.com/openstack/openstack-ansible-os_glance"
scm: git
version: "master"
- name: "os_gnocchi"
src: "https://github.com/openstack/openstack-ansible-os_gnocchi"
scm: git
version: "master"
- name: "os_heat"
src: "https://github.com/openstack/openstack-ansible-os_heat"
scm: git
version: "master"
- name: "os_horizon"
src: "https://github.com/openstack/openstack-ansible-os_horizon"
scm: git
version: "master"
- name: "os_ironic"
src: "https://github.com/openstack/openstack-ansible-os_ironic"
scm: git
version: "master"
- name: "os_keystone"
src: "https://github.com/openstack/openstack-ansible-os_keystone"
scm: git
version: "master"
- name: "os_magnum"
src: "https://github.com/openstack/openstack-ansible-os_magnum"
scm: git
version: "master"
- name: "os_monasca"
src: "https://github.com/openstack/openstack-ansible-os_monasca"
scm: git
version: "master"
- name: "os_neutron"
src: "https://github.com/openstack/openstack-ansible-os_neutron"
scm: git
version: "master"
- name: "os_nova"
src: "https://github.com/openstack/openstack-ansible-os_nova"
scm: git
version: "master"
- name: "os_rally"
src: "https://github.com/openstack/openstack-ansible-os_rally"
scm: git
version: "master"
- name: "os_sahara"
src: "https://github.com/openstack/openstack-ansible-os_sahara"
scm: git
version: "master"
- name: "os_swift"
src: "https://github.com/openstack/openstack-ansible-os_swift"
scm: git
version: "master"
- name: "os_tempest"
src: "https://github.com/openstack/openstack-ansible-os_tempest"
scm: git
version: "master"
- name: "os_trove"
src: "https://github.com/openstack/openstack-ansible-os_trove"
scm: git
version: "master"
- name: "os_watcher"
src: "https://github.com/openstack/openstack-ansible-os_watcher"
scm: git
version: "master"
- name: "os_zaqar"
src: "https://github.com/openstack/openstack-ansible-os_zaqar"
scm: git
version: "master"
- name: "pip_install"
src: "https://github.com/openstack/openstack-ansible-pip_install"
scm: git
version: "master"
- name: "pip_lock_down"
src: "https://github.com/openstack/openstack-ansible-pip_lock_down"
scm: git
version: "master"
- name: "plugins"
src: "https://github.com/openstack/openstack-ansible-plugins"
scm: git
version: "master"
- name: "rabbitmq_server"
src: "https://github.com/openstack/openstack-ansible-rabbitmq_server"
scm: git
version: "master"
- name: "repo_build"
src: "https://github.com/openstack/openstack-ansible-repo_build"
scm: git
version: "master"
- name: "repo_server"
src: "https://github.com/openstack/openstack-ansible-repo_server"
scm: git
version: "master"
- name: "rsyslog_client"
src: "https://github.com/openstack/openstack-ansible-rsyslog_client"
scm: git
version: "master"
- name: "rsyslog_server"
src: "https://github.com/openstack/openstack-ansible-rsyslog_server"
scm: git
version: "master"
- name: "security"
src: "https://github.com/openstack/openstack-ansible-security"
scm: git
version: "master"