Merge "Multi-distro pattern for repo_build role"

This commit is contained in:
Jenkins 2016-05-04 23:56:58 +00:00 committed by Gerrit Code Review
commit e6aa220131
5 changed files with 88 additions and 60 deletions

View File

@ -26,29 +26,6 @@ repo_build_pool_dir: "/var/www/repo/pools"
repo_build_release_tag: "untagged"
## APT Cache options
cache_timeout: 600
repo_build_apt_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
- python-dev
- swig
# Optionally set this to change the default index from pypi to an alternative
#repo_build_pip_default_index: "https://pypi.python.org/simple"

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

@ -0,0 +1,53 @@
---
# 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.
- name: Drop lxc-net override file
template:
src: manual-init.override.j2
dest: /etc/init/lxc-net.override
owner: root
group: root
mode: 0644
tags:
- repo-build-apt-packages
#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
tags:
- repo-build-apt-packages
- name: Update apt if needed
apt:
update_cache: yes
when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
tags:
- repo-build-apt-packages
- name: Install apt packages
apt:
pkg: "{{ item }}"
state: present
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: repo_build_apt_packages
tags:
- repo-build-apt-packages

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
# Wheel building
- include: repo_build_install.yml
- include: repo_clone_git.yml

View File

@ -13,41 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Drop lxc-net override file
template:
src: manual-init.override.j2
dest: /etc/init/lxc-net.override
owner: root
group: root
mode: 0644
- include: install-apt.yml
when:
- ansible_pkg_mgr == 'apt'
tags:
- repo-build-apt-packages
#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
tags:
- repo-build-apt-packages
- name: Update apt if needed
apt:
update_cache: yes
when: "ansible_date_time.epoch|float - apt_cache_stat.stat.mtime > {{cache_timeout}}"
tags:
- repo-build-apt-packages
- name: Install apt packages
apt:
pkg: "{{ item }}"
state: present
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: repo_build_apt_packages
tags:
- repo-build-apt-packages
- install-apt

22
vars/debian.yml Normal file
View File

@ -0,0 +1,22 @@
## APT Cache options
cache_timeout: 600
repo_build_apt_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
- python-dev
- swig