Skip to content
Snippets Groups Projects
Commit 96b3f0ae authored by Sean Mooney's avatar Sean Mooney
Browse files

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
parent d7dfae75
No related branches found
No related tags found
No related merge requests found
---
- hosts: localhost
roles:
- { role: bifrost,
tags: bifrost}
---
- 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'
---
- include: config.yml
- include: start.yml
- include: bootstrap.yml
---
- 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"
......@@ -66,54 +66,9 @@ Production
----------
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
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.
Prepare bifrost configs
=======================
create servers.yml
------------------
......@@ -121,7 +76,7 @@ create servers.yml
the servers.yml will discribing your physical nodes and list ipmi credentials.
see bifrost dynamic inventory examples for mor details.
e.g. /tmp/servers.yml
e.g. /etc/kolla/config/bifrost/servers.yml
---
cloud1:
......@@ -147,29 +102,138 @@ cloud1:
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
---------------------
=====================
ansible
-------
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 enroll-dynamic.yaml -e "ansible_python_interpreter=/var/lib/kolla/venv/bin/python" -e network_interface=<provisioning interface>
Deploy Nodes
------------
============
ansible
-------
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>
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
deabin image.
At this point ironic should clean down your nodes and install the default os image.
Advanced configuration
======================
Custom images
-------------
TODO
Bring your own image
--------------------
TODO
......
......@@ -5,3 +5,8 @@ prelude: >
Bifrost is a collection of ansible roles and
playbooks to deploy a standalone instance of
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.
......@@ -150,6 +150,11 @@ case "$1" in
PLAYBOOK="${BASEDIR}/ansible/kolla-host.yml"
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)
ACTION="Deploying Playbooks"
EXTRA_OPTS="$EXTRA_OPTS -e action=deploy"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment