Install Bifrost into Kayobe virtualenv
This commit is contained in:
parent
07a33c67df
commit
4ede1ae605
@ -1,6 +1,15 @@
|
|||||||
---
|
---
|
||||||
# Kayobe configuration for Bifrost.
|
# 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.
|
# Diskimage-builder configuration.
|
||||||
|
|
||||||
|
@ -51,8 +51,8 @@ kolla_openstack_release: "4.0.0.0rc1"
|
|||||||
kolla_sources:
|
kolla_sources:
|
||||||
bifrost-base:
|
bifrost-base:
|
||||||
type: "git"
|
type: "git"
|
||||||
location: "https://github.com/stackhpc/bifrost"
|
location: "{{ kolla_bifrost_source_url }}"
|
||||||
reference: "stackhpc-3.0.0"
|
reference: "{{ kolla_bifrost_source_version }}"
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Kolla-ansible configuration.
|
# Kolla-ansible configuration.
|
||||||
|
@ -7,6 +7,14 @@
|
|||||||
- { name: agent_ipmitool, enabled: "{{ kolla_bifrost_enable_ipmitool_drivers | bool }}" }
|
- { name: agent_ipmitool, enabled: "{{ kolla_bifrost_enable_ipmitool_drivers | bool }}" }
|
||||||
|
|
||||||
pre_tasks:
|
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
|
- name: Check whether a Kolla Bifrost extra globals configuration file exists
|
||||||
stat:
|
stat:
|
||||||
path: "{{ kolla_bifrost_extra_globals_path }}"
|
path: "{{ kolla_bifrost_extra_globals_path }}"
|
||||||
@ -20,6 +28,8 @@
|
|||||||
roles:
|
roles:
|
||||||
- role: kolla-bifrost
|
- role: kolla-bifrost
|
||||||
|
|
||||||
|
kolla_bifrost_venv: "{{ lookup('env', 'VIRTUAL_ENV') }}"
|
||||||
|
|
||||||
# Generate a list of enabled drivers from the map.
|
# Generate a list of enabled drivers from the map.
|
||||||
kolla_bifrost_enabled_drivers: >
|
kolla_bifrost_enabled_drivers: >
|
||||||
{{ kolla_bifrost_driver_map | selectattr('enabled') | map(attribute='name') | list }}
|
{{ kolla_bifrost_driver_map | selectattr('enabled') | map(attribute='name') | list }}
|
||||||
|
@ -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.
|
# Directory where Kolla custom configuration files will be installed.
|
||||||
kolla_node_custom_config_path:
|
kolla_node_custom_config_path:
|
||||||
|
|
||||||
|
18
ansible/roles/kolla-bifrost/tasks/config.yml
Normal file
18
ansible/roles/kolla-bifrost/tasks/config.yml
Normal 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 }
|
44
ansible/roles/kolla-bifrost/tasks/install.yml
Normal file
44
ansible/roles/kolla-bifrost/tasks/install.yml
Normal 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
|
@ -1,18 +1,3 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure the Kolla Bifrost configuration directores exist
|
- include: install.yml
|
||||||
file:
|
- include: config.yml
|
||||||
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 }
|
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
---
|
---
|
||||||
# Kayobe configuration for Bifrost.
|
# 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.
|
# Diskimage-builder configuration.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user