openstack-ansible/playbooks/repo-clone-mirror.yml
Kevin Carter d7f496601f
Updated the repo build templates
The change makes it so the upper constraints file is created
specifically using the repos indexed and cloned. Previously the
constraint file was created using the git repos found within the
local openstackgit directory and while that works for greenfield
deployments it does have the potential to create additional entries
that may or may not work with an environment.

The manifest file now uses normalized file names and will track the
exact git repos needed to power a build. This will allow for more
targetted syncs from an upstream mirror to happen using the
`repo-clone-mirror.yml` play.

The venv build process will now check for a prebuilt venv using the
versioned file name.

Change-Id: If4416f660133a6c65badba0c7c819a6409bfe11e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-10-24 02:46:55 -05:00

69 lines
2.4 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.
# This play was built to seed an environment with packages that may be used
# from within the environment as found from a given mirror_source_host.
# Currently the mirror source host is set to the Rackspace build servers but
# could be targeted to wherever you'd like.
- name: Cloning the upstream repo mirror
hosts: repo_all[0]
gather_facts: false
user: root
pre_tasks:
- name: Delete old MANIFEST file if found
file:
state: absent
path: /tmp/MANIFEST.in
tasks:
- name: download MANIFEST.in
get_url:
url: "{{ repo_upstream_manifest_url }}"
dest: /tmp/MANIFEST.in
- name: Sync the upstream repo(s)
shell: |
{{ rsync_commands }} \
{{ rsync_flags }} \
--files-from=/tmp/MANIFEST.in \
{{ repo_upstream_url | netloc }}::{{ mirror_name }} {{ mirror_path }}
sudo: yes
sudo_user: "{{ repo_service_user_name }}"
- name: Create sync directories
file:
state: directory
path: "{{ mirror_path }}/{{ item }}"
owner: "{{ repo_service_user_name }}"
with_items: rsync_dirs
- name: Sync supporting directories
shell: |
{{ rsync_commands }} \
{{ rsync_flags }} \
{{ repo_upstream_url | netloc }}::{{ mirror_name }}/{{ item }}/ {{ mirror_path }}/{{ item }}
with_items: rsync_dirs
sudo: yes
sudo_user: "{{ repo_service_user_name }}"
vars:
rsync_commands: rsync
rsync_flags: "-avzlHAX"
rsync_dirs:
- container_images
- downloads
- "venvs/{{ openstack_release }}"
mirror_path: "{{ repo_service_home_folder }}/repo"
mirror_name: "openstack_mirror"
repo_upstream_url: "https://rpc-repo.rackspace.com"
repo_upstream_manifest_url: "{{ repo_upstream_url }}/os-releases/{{ openstack_release }}/MANIFEST.in"
repo_service_user_name: nginx