Merge "Updating os_rally to use the Multi-Distro framework"

This commit is contained in:
Jenkins 2016-05-31 19:09:26 +00:00 committed by Gerrit Code Review
commit 25114ed587
7 changed files with 72 additions and 13 deletions

View File

@ -48,18 +48,6 @@ rally_galera_database: rally
rally_galera_user: rally
rally_database_connection_string: mysql+pymysql://{{ rally_galera_user }}:{{ rally_galera_password }}@{{ rally_galera_address }}/{{ rally_galera_database }}?charset=utf8
rally_apt_packages:
- build-essential
- libssl-dev
- libffi-dev
- python-dev
- libxml2-dev
- libxslt1-dev
- libpq-dev
- git
- wget
- pymysql
# Packages that must be installed before anything else
rally_requires_pip_packages:
- virtualenv

View File

@ -10,7 +10,9 @@ galaxy_info:
- trusty
galaxy_tags: []
dependencies:
- apt_package_pinning
- role: apt_package_pinning
when:
- ansible_pkg_mgr == 'apt'
- galera_client
- pip_install
- openstack_openrc

37
tasks/install-apt.yml Normal file
View File

@ -0,0 +1,37 @@
---
# Copyright 2016, Comcast Corporation
#
# 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.
#TODO(evrardjp): Replace the next 2 tasks by a standard apt with cache
#when https://github.com/ansible/ansible-modules-core/pull/1517 is merged
#in 1.9.x or we move to 2.0 (if tested working)
- name: Check apt last update file
stat:
path: /var/cache/apt
register: apt_cache_stat
- name: Update apt if needed
apt:
update_cache: yes
when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
- name: Install apt packages
apt:
pkg: "{{ item }}"
state: latest
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: rally_apt_packages

View File

@ -13,6 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- include: install-apt.yml
when:
- ansible_pkg_mgr == 'apt'
tags:
- install-apt
- name: Create developer mode constraint file
copy:
dest: "/opt/developer-pip-constraints.txt"

View File

@ -13,6 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Gather variables for each operating system
include_vars: "{{ item }}"
with_first_found:
- "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
- "{{ ansible_distribution | lower }}.yml"
- "{{ ansible_os_family | lower }}.yml"
tags:
- always
- include: pre-install.yml
- include: install.yml

View File

@ -39,10 +39,14 @@
shell: 'awk "/^deb .*ubuntu\/? {{ ansible_distribution_release }} main/ {print \$2; exit}" /etc/apt/sources.list'
register: ubuntu_repo
changed_when: false
when:
- ansible_pkg_mgr == 'apt'
- name: Set apt repo facts based on discovered information
set_fact:
lxc_container_template_main_apt_repo: "{{ ubuntu_repo.stdout }}"
lxc_container_template_security_apt_rep: "{{ ubuntu_repo.stdout }}"
when:
- ansible_pkg_mgr == 'apt'
roles:
- role: "lxc_hosts"
lxc_net_address: 10.100.100.1

View File

@ -12,3 +12,16 @@
# 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.
cache_timeout: 600
rally_apt_packages:
- build-essential
- libssl-dev
- libffi-dev
- python-dev
- libxml2-dev
- libxslt1-dev
- libpq-dev
- git
- wget