Install Bifrost into Kayobe virtualenv

This commit is contained in:
Mark Goddard 2017-03-15 09:44:19 +00:00
parent 07a33c67df
commit 4ede1ae605
8 changed files with 106 additions and 19 deletions

View File

@ -1,6 +1,15 @@
---
# Kayobe configuration for Bifrost.
###############################################################################
# Bifrost installation.
# URL of Bifrost source code repository.
kolla_bifrost_source_url: "https://github.com/stackhpc/bifrost"
# Version (branch, tag, etc.) of Bifrost source code repository.
kolla_bifrost_source_version: "stackhpc-3.0.0"
###############################################################################
# Diskimage-builder configuration.

View File

@ -51,8 +51,8 @@ kolla_openstack_release: "4.0.0.0rc1"
kolla_sources:
bifrost-base:
type: "git"
location: "https://github.com/stackhpc/bifrost"
reference: "stackhpc-3.0.0"
location: "{{ kolla_bifrost_source_url }}"
reference: "{{ kolla_bifrost_source_version }}"
###############################################################################
# Kolla-ansible configuration.

View File

@ -7,6 +7,14 @@
- { name: agent_ipmitool, enabled: "{{ kolla_bifrost_enable_ipmitool_drivers | bool }}" }
pre_tasks:
- name: Fail if not running in a virtualenv
fail:
msg: >
This playbook should be executed from a virtualenv in order to avoid
installing python packages to the system location. Typically this
will be named 'kayobe-venv'
when: "{{ not lookup('env', 'VIRTUAL_ENV') }}"
- name: Check whether a Kolla Bifrost extra globals configuration file exists
stat:
path: "{{ kolla_bifrost_extra_globals_path }}"
@ -20,6 +28,8 @@
roles:
- role: kolla-bifrost
kolla_bifrost_venv: "{{ lookup('env', 'VIRTUAL_ENV') }}"
# Generate a list of enabled drivers from the map.
kolla_bifrost_enabled_drivers: >
{{ kolla_bifrost_driver_map | selectattr('enabled') | map(attribute='name') | list }}

View File

@ -1,4 +1,16 @@
---
# Path to directory for source code checkouts.
source_checkout_path:
# Virtualenv directory where Bifrost will be installed.
kolla_bifrost_venv:
# URL of Bifrost source code repository.
kolla_bifrost_source_url:
# Version (branch, tag, etc.) of Bifrost source code repository.
kolla_bifrost_source_version:
# Directory where Kolla custom configuration files will be installed.
kolla_node_custom_config_path:

View File

@ -0,0 +1,18 @@
---
- name: Ensure the Kolla Bifrost configuration directores exist
file:
path: "{{ kolla_node_custom_config_path }}/bifrost"
state: directory
mode: 0755
become: True
- name: Ensure the Kolla Bifrost configuration files exist
template:
src: "{{ item.src }}"
dest: "{{ kolla_node_custom_config_path }}/bifrost/{{ item.dest }}"
mode: 0644
become: True
with_items:
- { src: bifrost.yml.j2, dest: bifrost.yml }
- { src: dib.yml.j2, dest: dib.yml }
- { src: servers.yml.j2, dest: servers.yml }

View File

@ -0,0 +1,44 @@
---
- name: Ensure required packages are installed
yum:
name: "{{ item }}"
state: installed
become: True
with_items:
- gcc
- libffi-devel
- openssl-devel
- python-devel
- python-pip
- python-virtualenv
- name: Ensure the latest version of pip is installed
pip:
name: "{{ item.name }}"
state: latest
virtualenv: "{{ kolla_bifrost_venv }}"
with_items:
- { name: pip }
- name: Ensure source code checkout path exists
file:
path: "{{ source_checkout_path }}"
state: directory
recurse: True
- name: Ensure Bifrost source code checkout exists
git:
repo: "{{ kolla_bifrost_source_url }}"
dest: "{{ source_checkout_path }}/bifrost"
version: "{{ kolla_bifrost_source_version }}"
- name: Ensure required Python packages are installed
pip:
name: "{{ item.name }}"
version: "{{ item.version | default(omit) }}"
state: present
virtualenv: "{{ kolla_bifrost_venv }}"
with_items:
# Intall Bifrost from source.
- name: "{{ source_checkout_path }}/bifrost"
- name: shade

View File

@ -1,18 +1,3 @@
---
- name: Ensure the Kolla Bifrost configuration directores exist
file:
path: "{{ kolla_node_custom_config_path }}/bifrost"
state: directory
mode: 0755
become: True
- name: Ensure the Kolla Bifrost configuration files exist
template:
src: "{{ item.src }}"
dest: "{{ kolla_node_custom_config_path }}/bifrost/{{ item.dest }}"
mode: 0644
become: True
with_items:
- { src: bifrost.yml.j2, dest: bifrost.yml }
- { src: dib.yml.j2, dest: dib.yml }
- { src: servers.yml.j2, dest: servers.yml }
- include: install.yml
- include: config.yml

View File

@ -1,6 +1,15 @@
---
# Kayobe configuration for Bifrost.
###############################################################################
# Bifrost installation.
# URL of Bifrost source code repository.
#kolla_bifrost_source_url:
# Version (branch, tag, etc.) of Bifrost source code repository.
#kolla_bifrost_source_version:
###############################################################################
# Diskimage-builder configuration.