Add and enable UCA repo by default

When the UCA repo is enabled for nova, a newer version of libvirt will
be installed. The repo_build role will also need to have the UCA repo
enabled to install the same version of libvirt-dev so that a
corresponding libvirt-python wheel will be built.

The test preparation implements an override of the URL for OpenStack-CI
to make use of the local mirrors.

Change-Id: I6d5532e862e98929cff868f940c202875d1ee560
This commit is contained in:
Jimmy McCrory 2016-07-19 00:13:24 -07:00
parent 4158c82268
commit f4f7009925
6 changed files with 95 additions and 1 deletions

View File

@ -37,6 +37,11 @@ repo_build_release_tag: "untagged"
# in Newton.
# repo_build_pip_extra_index: "https://pypi.python.org/simple"
# Toggle the use of Ubuntu Cloud Archive
repo_build_uca_enable: True
# Ubuntu Cloud Archive mirror URL
uca_apt_repo_url: "http://ubuntu-cloud.archive.canonical.com/ubuntu"
repo_build_timeout: 120
repo_build_concurrency: "{{ ansible_processor_count if ansible_processor_count > 0 else 5}}"
repo_build_venv_build_dir: "/tmp/openstack-venv-builder"

View File

@ -0,0 +1,4 @@
---
upgrade:
- The ``repo_build`` role now makes use of Ubuntu Cloud Archive by default.
This can be disabled by setting ``repo_build_uca_enable`` to ``False``.

View File

@ -13,6 +13,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Add Ubuntu Cloud Archive keyring
apt:
pkg: ubuntu-cloud-keyring
state: latest
register: add_uca_keys
when: repo_build_uca_enable | bool
- name: Add Ubuntu Cloud Archive Repository
apt_repository:
repo: "{{ uca_repo }}"
state: present
register: add_uca_repo
when: repo_build_uca_enable | bool
- name: Drop lxc-net override file
template:
src: manual-init.override.j2
@ -36,7 +50,8 @@
- name: Update apt if needed
apt:
update_cache: yes
when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
when: ("ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}" or
add_uca_keys | changed or add_uca_repo | changed)
tags:
- repo-build-apt-packages

View File

@ -16,6 +16,26 @@
- name: Build repo
hosts: repo_all
user: root
pre_tasks:
- name: Check if this is an OpenStack-CI nodepool instance
stat:
path: /etc/nodepool/provider
register: nodepool
delegate_to: localhost
- name: Determine the existing Ubuntu repo URL (only on OpenStack-CI)
shell: 'awk "/^deb .*ubuntu\/? {{ ansible_distribution_release }} main/ {print \$2; exit}" /etc/apt/sources.list'
register: ubuntu_repo_url
changed_when: false
when:
- ansible_pkg_mgr == 'apt'
- nodepool.stat.exists | bool
delegate_to: localhost
- name: Set Ubuntu Cloud Archive repo URL based on discovered information
set_fact:
uca_apt_repo_url: "{{ ubuntu_repo_url.stdout | netorigin }}/ubuntu-cloud-archive"
when:
- ansible_pkg_mgr == 'apt'
- nodepool.stat.exists | bool
roles:
- "repo_server"
- "{{ rolename | basename }}"

45
vars/ubuntu-14.04.yml Normal file
View File

@ -0,0 +1,45 @@
---
# 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.
## APT Cache options
cache_timeout: 600
# Ubuntu Cloud Archive variables
# There are no UCA packages for Trusty beyond Mitaka, so the selected
# release here has to remain at Mitaka.
uca_openstack_release: mitaka
uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}"
uca_repo: "deb {{ uca_apt_repo_url }} {{ uca_repo_dist }} main"
repo_build_packages:
- build-essential
- cmake
- git
- liberasurecode-dev # required to build pyeclib
- libffi-dev # required to build xattr
- libjpeg-dev # required to build pillow
- libkrb5-dev # required to build pykerberos
- libldap2-dev # required to build python-ldap
- libmariadbclient-dev # required to build MySQL-python
- libpq-dev # required to build psycopg2
- libsasl2-dev # required to build python-ldap
- libsqlite3-dev # required to build pysqlite
- libssl-dev # required to build cryptography
- libvirt-dev # required to build libvirt-python
- libxslt1-dev # required to build lxml
- lxc-dev # required to build lxc-python2
- pkg-config
- python-dev
- swig

View File

@ -16,6 +16,11 @@
## APT Cache options
cache_timeout: 600
# Ubuntu Cloud Archive variables
uca_openstack_release: newton
uca_repo_dist: "{{ ansible_lsb.codename }}-updates/{{ uca_openstack_release }}"
uca_repo: "deb {{ uca_apt_repo_url }} {{ uca_repo_dist }} main"
repo_build_packages:
- build-essential
- cmake