openstack-ansible/playbooks/repo-build.yml
Adam Reznechek 108ea96349 Add discovery and build for multiple CPU architectures
This adds support for discovery of repo build servers for multiple
CPU architectures. When multiple architectures are detected among the
repo servers, this patch allows repo-install to assign and store a list
of 'master' build servers for each CPU architecture, then use this to
build artifacts independently for each CPU architecture in the deployment.

Partially-Implements: bp/multi-arch-repo

Change-Id: Ibfb77cc4ce87c9064f9af84946c5a9bbba5e1fb4
2016-08-12 18:17:35 +00:00

55 lines
1.7 KiB
YAML

---
# Copyright 2015, 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.
- name: Group repo servers by architecture
hosts: repo_all
tasks:
- name: Group repo servers by architecture
group_by:
key: repo_servers_{{ ansible_architecture }}
tags:
- "repo-build"
# repo_all[0] is built last to ensure it has all build artifacts for final indexing
- name: Build new repo packages for a given release
hosts: repo_all[1:],repo_all[0]
gather_facts: true
user: root
serial: 1
pre_tasks:
- name: Load local packages
debug:
msg: "Loading Packages"
when:
- "groups['repo_servers_{{ ansible_architecture }}'] | length > 0"
- "inventory_hostname == groups['repo_servers_{{ ansible_architecture }}'][0]"
with_py_pkgs: "{{ pkg_locations }}"
register: local_packages
tags:
- always
roles:
- role: "repo_build"
repo_build_release_tag: "{{ openstack_release }}"
when:
- "groups['repo_servers_{{ ansible_architecture }}'] | length > 0"
- "inventory_hostname == groups['repo_servers_{{ ansible_architecture }}'][0]"
tags:
- "repo-build"
vars:
pkg_locations:
- ../
- /etc/ansible/roles
- /etc/openstack_deploy