add bifrost deploy ansible support

- This change addes the ability to deploy
  and bootstrap bifrost.
- This change introduces a deploy-bifrost
  command to kolla-ansible.

Change-Id: I62afcf348661add900c98904e90a15a0eddffd4b
Implements: blueprint bifrost-support
This commit is contained in:
Sean Mooney 2016-08-01 19:11:50 +00:00
parent d7dfae75b2
commit 96b3f0ae3e
7 changed files with 161 additions and 58 deletions

5
ansible/bifrost.yml Normal file
View File

@ -0,0 +1,5 @@
---
- hosts: localhost
roles:
- { role: bifrost,
tags: bifrost}

View File

@ -0,0 +1,9 @@
---
- name: Bootstrap bifrost (this may take several minutes)
command: >
docker exec bifrost_deploy
bash -c '/bifrost/scripts/env-setup.sh && source /bifrost/env-vars
&& source /opt/stack/ansible/hacking/env-setup &&
ansible-playbook -vvvv -i /bifrost/playbooks/inventory/localhost
/bifrost/playbooks/install.yaml -e @/etc/bifrost/bifrost.yml
-e @/etc/bifrost/dib.yml -e skip_package_install=true'

View File

@ -1,3 +1,5 @@
--- ---
- include: config.yml - include: config.yml
- include: start.yml
- include: bootstrap.yml

View File

@ -0,0 +1,13 @@
---
- name: Starting bifrost deploy container
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
image: "{{ bifrost_deploy_image_full }}"
name: "bifrost_deploy"
privileged: True
volumes:
- "{{ node_config_directory }}/bifrost/:/etc/bifrost:ro"
- "/etc/localtime:/etc/localtime:ro"
- "/dev:/dev"

View File

@ -66,54 +66,9 @@ Production
---------- ----------
kolla-build bifrost-deploy kolla-build bifrost-deploy
launch bifrost
==============
docker run -it --net=host -v /dev:/dev -d --privileged --name bifrost 192.168.1.51:5000/kollaglue/ubuntu-source-bifrost-deploy:3.0.0 Prepare bifrost configs
=======================
bootstrap bifrost ansible
=========================
TODO
bootstrap bifrost manual
========================
docker exec -it bifrost bash
generate ssh key
----------------
ssh-keygen
# source env variables
cd /bifrost
. env-vars
. /opt/stack/ansible/hacking/env-setup
cd playbooks/
create /tmp/bootstrap_args
--------------------------
skip_package_install: true
mysql_service_name: mysql
ansible_python_interpreter: /var/lib/kolla/venv/bin/python
network_interface: < add you network interface here >
# uncomment below if needed
# dhcp_pool_start: 192.168.2.200
# dhcp_pool_end: 192.168.2.250
# dhcp_lease_time: 12h
# dhcp_static_mask: 255.255.255.0
bootstap and start services
---------------------------
ansible-playbook -vvvv -i /bifrost/playbooks/inventory/localhost /bifrost/playbooks/install.yaml -e @/tmp/bootstrap_args
Use bifrost
===========
check with "ironic node-list" should return with no nodes.
create servers.yml create servers.yml
------------------ ------------------
@ -121,7 +76,7 @@ create servers.yml
the servers.yml will discribing your physical nodes and list ipmi credentials. the servers.yml will discribing your physical nodes and list ipmi credentials.
see bifrost dynamic inventory examples for mor details. see bifrost dynamic inventory examples for mor details.
e.g. /tmp/servers.yml e.g. /etc/kolla/config/bifrost/servers.yml
--- ---
cloud1: cloud1:
@ -147,29 +102,138 @@ cloud1:
adjust as appropriate for your deployment adjust as appropriate for your deployment
create bifrost.yml
------------------
By default kolla mostly use bifrosts default playbook values.
Parameters passed to the bifrost install playbook can be overriden by
creating a bifrost.yml file in the kolla custom config director or in a
bifrost sub directory.
e.g. /etc/kolla/config/bifrost/bifrost.yml
skip_package_install: true
mysql_service_name: mysql
ansible_python_interpreter: /var/lib/kolla/venv/bin/python
network_interface: < add you network interface here >
# uncomment below if needed
# dhcp_pool_start: 192.168.2.200
# dhcp_pool_end: 192.168.2.250
# dhcp_lease_time: 12h
# dhcp_static_mask: 255.255.255.0
Create Disk Image Builder Config
--------------------------------
By default kolla mostly use bifrosts default playbook values when
building the baremetal os image. The baremetal os image can be customised
by creating a dib.yml file in the kolla custom config director or in a
bifrost sub directory.
e.g. /etc/kolla/config/bifrost/dib.yml
dib_os_element: ubuntu
Deploy Bifrost
=========================
manual
------
Start Bifrost Container
_______________________
docker run -it --net=host -v /dev:/dev -d --privileged --name bifrost_deploy 192.168.1.51:5000/kollaglue/ubuntu-source-bifrost-deploy:3.0.0
copy configs
____________
docker exec -it bifrost_deploy mkdir /etc/bifrost
docker cp /etc/kolla/config/bifrost/servers.yml bifrost_deploy:/etc/bifrost/servers.yml
docker cp /etc/kolla/config/bifrost/bifrost.yml bifrost_deploy:/etc/bifrost/bifrost.yml
docker cp /etc/kolla/config/bifrost/dib.yml bifrost_deploy:/etc/bifrost/dib.yml
bootstrap bifrost
_________________
docker exec -it bifrost_deploy bash
generate ssh key
~~~~~~~~~~~~~~~~
ssh-keygen
source env variables
~~~~~~~~~~~~~~~~~~~~
cd /bifrost
. env-vars
. /opt/stack/ansible/hacking/env-setup
cd playbooks/
bootstap and start services
~~~~~~~~~~~~~~~~~~~~~~~~~~~
ansible-playbook -vvvv -i /bifrost/playbooks/inventory/localhost /bifrost/playbooks/install.yaml -e @/etc/bifrost/bifrost.yml
ansible
-------
Development
___________
tools/kolla-ansible bifrost-deploy -e bifrost_network_interface=<pxe network interface>
Production
__________
kolla-ansible deploy-kolla -e bifrost_network_interface=<pxe network interface>
Check ironic is running
=======================
docker exec -it bifrost_deploy bash
cd /bifrost
. env-vars
running "ironic node-list" should return with no nodes.
e.g.
(bifrost-deploy)[root@bifrost bifrost]# ironic node-list
+------+------+---------------+-------------+--------------------+-------------+
| UUID | Name | Instance UUID | Power State | Provisioning State | Maintenance |
+------+------+---------------+-------------+--------------------+-------------+
+------+------+---------------+-------------+--------------------+-------------+
Enroll Physical Nodes Enroll Physical Nodes
--------------------- =====================
ansible
-------
TODO
manual
------
docker exec -it bifrost_deploy bash
cd /bifrost
. env-vars
export BIFROST_INVENTORY_SOURCE=/tmp/servers.yml export BIFROST_INVENTORY_SOURCE=/tmp/servers.yml
ansible-playbook -vvvv -i inventory/bifrost_inventory.py enroll-dynamic.yaml -e "ansible_python_interpreter=/var/lib/kolla/venv/bin/python" -e network_interface=<provisioning interface> ansible-playbook -vvvv -i inventory/bifrost_inventory.py enroll-dynamic.yaml -e "ansible_python_interpreter=/var/lib/kolla/venv/bin/python" -e network_interface=<provisioning interface>
Deploy Nodes Deploy Nodes
------------ ============
export BIFROST_INVENTORY_SOURCE=/tmp/servers.yml
ansible-playbook -vvvv -i inventory/bifrost_inventory.py deploy-dynamic.yaml -e "ansible_python_interpreter=/var/lib/kolla/venv/bin/python" -e network_interface=<prvisioning interface>
at this point ironic should clean down your nodes and install the default ansible
deabin image. -------
TODO
manual
------
docker exec -it bifrost_deploy bash
cd /bifrost
. env-vars
export BIFROST_INVENTORY_SOURCE=/tmp/servers.yml
ansible-playbook -vvvv -i inventory/bifrost_inventory.py deploy-dynamic.yaml -e "ansible_python_interpreter=/var/lib/kolla/venv/bin/python" -e network_interface=<prvisioning interface> -e @/etc/bifrost/dib.yml
At this point ironic should clean down your nodes and install the default os image.
Advanced configuration Advanced configuration
====================== ======================
Custom images
-------------
TODO
Bring your own image Bring your own image
-------------------- --------------------
TODO TODO

View File

@ -5,3 +5,8 @@ prelude: >
Bifrost is a collection of ansible roles and Bifrost is a collection of ansible roles and
playbooks to deploy a standalone instance of playbooks to deploy a standalone instance of
ironic. ironic.
features:
- A new deploy-bifrost command was added to
kolla-ansible. The deploy-bifrost command
will deploy and bootstrap a standalone
instance of ironic in a single container.

View File

@ -150,6 +150,11 @@ case "$1" in
PLAYBOOK="${BASEDIR}/ansible/kolla-host.yml" PLAYBOOK="${BASEDIR}/ansible/kolla-host.yml"
EXTRA_OPTS="$EXTRA_OPTS -e action=bootstrap-servers" EXTRA_OPTS="$EXTRA_OPTS -e action=bootstrap-servers"
;; ;;
(bifrost-deploy)
ACTION="Deploying Bifrost"
PLAYBOOK="${BASEDIR}/ansible/bifrost.yml"
EXTRA_OPTS="$EXTRA_OPTS -e action=deploy"
;;
(deploy) (deploy)
ACTION="Deploying Playbooks" ACTION="Deploying Playbooks"
EXTRA_OPTS="$EXTRA_OPTS -e action=deploy" EXTRA_OPTS="$EXTRA_OPTS -e action=deploy"