Enable developer mode with upper-constraints

This commit adds the ability to install Ironic without requiring an
OpenStack-Ansible pip wheel repository.

In 'developer mode' the git source is cloned directly and the services
are installed directly from the git clone with its requirements being
installed from pypi. The OpenStack upper-constraints file is also used
to ensure that the install is executed using the appropriately tested
set of pypi packages.

Change-Id: I38f6b0796fa2bb647e51194907274d9ca6cfb585
This commit is contained in:
Jesse Pretorius 2016-03-21 14:09:16 +00:00 committed by Jesse Pretorius (odyssey4me)
parent ff29558c81
commit 5e69f88ed9
7 changed files with 82 additions and 59 deletions

View File

@ -19,8 +19,16 @@
debug: False
verbose: True
# Update source
update_src: True
# These variables are used in 'developer mode' in order to allow the role
# to build an environment directly from a git source without the presence
# of an OpenStack-Ansible repo_server.
ironic_git_repo: https://git.openstack.org/openstack/ironic
ironic_git_install_branch: master
ironic_requirements_git_repo: https://git.openstack.org/openstack/requirements
ironic_requirements_git_install_branch: master
ironic_developer_mode: false
ironic_developer_constraints:
- "git+{{ ironic_git_repo }}@{{ ironic_git_install_branch }}#egg=ironic"
# Name of the virtual env to deploy into
ironic_venv_tag: untagged
@ -110,9 +118,10 @@ ironic_common_apt_packages:
- python-pip
- git
ironic_common_pip_packages:
- python-keystoneclient
- virtualenvwrapper
ironic_requires_pip_packages:
- virtualenv
- virtualenv-tools
- python-keystoneclient # Keystoneclient needed for the OSA keystone lib
ironic_pip_packages:
- mysql-python

View File

@ -31,7 +31,7 @@
pip:
name: "{{ item }}"
state: present
extra_args: "{{ pip_install_options|default('') }}"
extra_args: "{{ pip_install_options_fact }}"
register: install_packages
until: install_packages|success
retries: 5

View File

@ -46,7 +46,7 @@
pip:
name: "{{ item }}"
state: present
extra_args: "{{ pip_install_options|default('') }}"
extra_args: "{{ pip_install_options_fact }}"
register: install_packages
until: install_packages|success
retries: 5

View File

@ -1,33 +0,0 @@
---
# Copyright 2014, 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: git clone ironic source code
git: repo=https://github.com/openstack/ironic.git
dest={{ ironic_git_dest }}
version={{ ironic_git_install_branch }}
update={{ update_src }}
register: ironic_checkout
tags:
- ironic-api
- ironic-conductor
- name: git clone python-ironicclient source code
git: repo=https://github.com/openstack/python-ironicclient.git
dest={{ python_ironicclient_git_dest }}
version={{ python_ironicclient_git_install_branch }}
update={{ update_src }}
register: python_ironicclient_checkout
tags:
- ironic-client

View File

@ -13,13 +13,71 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Create developer mode constraint file
copy:
dest: "/opt/developer-pip-constraints.txt"
content: |
{% for item in ironic_developer_constraints %}
{{ item }}
{% endfor %}
when:
- ironic_developer_mode | bool
tags:
- ironic-install
- ironic-pip-packages
- name: Clone requirements git repository
git:
repo: "{{ ironic_requirements_git_repo }}"
dest: "/opt/requirements"
clone: yes
update: yes
version: "{{ ironic_requirements_git_install_branch }}"
when:
- ironic_developer_mode | bool
tags:
- ironic-install
- ironic-pip-packages
- name: Add constraints to pip_install_options fact for developer mode
set_fact:
pip_install_options_fact: "{{ pip_install_options|default('') }} --constraint /opt/developer-pip-constraints.txt --constraint /opt/requirements/upper-constraints.txt"
when:
- ironic_developer_mode | bool
tags:
- ironic-install
- ironic-pip-packages
- name: Set pip_install_options_fact when not in developer mode
set_fact:
pip_install_options_fact: "{{ pip_install_options|default('') }}"
when:
- not ironic_developer_mode | bool
tags:
- ironic-install
- ironic-pip-packages
- name: Install requires pip packages
pip:
name: "{{ item }}"
state: present
extra_args: "{{ pip_install_options_fact }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: ironic_requires_pip_packages
tags:
- ironic-install
- ironic-pip-packages
- name: Install pip packages (venv)
pip:
name: "{{ item }}"
state: present
virtualenv: "{{ ironic_venv_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options|default('') }}"
extra_args: "{{ pip_install_options_fact }}"
register: install_packages
until: install_packages|success
retries: 5
@ -28,6 +86,7 @@
- "{{ ironic_pip_packages }}"
when:
- ironic_venv_enabled | bool
- ironic_developer_mode | bool
tags:
- ironic-install
- ironic-pip-packages
@ -36,14 +95,16 @@
pip:
name: "{{ item }}"
state: present
extra_args: "{{ pip_install_options|default('') }}"
extra_args: "{{ pip_install_options_fact }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items:
- "{{ ironic_pip_packages }}"
when: not ironic_venv_enabled | bool
when:
- not ironic_venv_enabled | bool
- not ironic_developer_mode | bool
tags:
- ironic-install
- ironic-pip-packages

View File

@ -139,20 +139,6 @@
- ironic-install
- ironic-apt-packages
- name: Install common dependencies via pip
pip:
name: "{{ item }}"
state: present
extra_args: "{{ pip_install_options|default('') }}"
register: install_packages
until: install_packages|success
retries: 5
delay: 2
with_items: ironic_common_pip_packages
tags:
- ironic-install
- ironic-pip-packages
- include: ironic_messaging_setup.yml
when: >
inventory_hostname == groups['ironic_all'][0]

View File

@ -19,7 +19,7 @@
state: present
virtualenv: "{{ ironic_venv_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options|default('') }}"
extra_args: "{{ pip_install_options_fact }}"
register: install_packages
until: install_packages|success
retries: 5
@ -36,7 +36,7 @@
pip:
name: "{{ item }}"
state: present
extra_args: "{{ pip_install_options|default('') }}"
extra_args: "{{ pip_install_options_fact }}"
register: install_packages
until: install_packages|success
retries: 5