From 9112e2fdf579cc54296d7806b7bd4dde8a07d87a Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 29 Aug 2016 14:53:42 -0500 Subject: [PATCH] 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 --- ansible-role-requirements-gen.sh | 69 +++++++++++++ ansible-role-requirements.yaml | 169 +++++++++++++++++++++++++++++++ 2 files changed, 238 insertions(+) create mode 100755 ansible-role-requirements-gen.sh create mode 100644 ansible-role-requirements.yaml diff --git a/ansible-role-requirements-gen.sh b/ansible-role-requirements-gen.sh new file mode 100755 index 00000000..d1e034cf --- /dev/null +++ b/ansible-role-requirements-gen.sh @@ -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" < "${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}" diff --git a/ansible-role-requirements.yaml b/ansible-role-requirements.yaml new file mode 100644 index 00000000..86d4d6dd --- /dev/null +++ b/ansible-role-requirements.yaml @@ -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"