From 00a1bd3ae5b307368efb918d8db751572be20cce Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Thu, 16 Feb 2017 16:35:44 +0000
Subject: [PATCH] Add an Ansible group for bifrost

It is not currently possible to deploy Bifrost on a host other than the
Ansible control host. A deployer may want to manage an Ansible control
environment remotely from the Bifrost deployment host but is currently
unable to.

This change adds a new top level 'deployment' Ansible group and a
'bifrost' Ansible group containing the 'deployment' group. The Ansible
play in ansible/bifrost.yml is now targeted at the hosts in the
'bifrost' group. For backwards compatibility, the all-in-one and
multinode inventories add localhost to the deployment group. This allows
a deployer to deploy Bifrost on a remote host by modifying the hosts in
the deployment or bifrost groups.

Change-Id: I76808feab5dd67dff63379ed9c7d08a105636acf
Closes-bug: #1665373
---
 ansible/bifrost.yml          |  2 +-
 ansible/inventory/all-in-one |  6 ++++++
 ansible/inventory/multinode  |  6 ++++++
 doc/bifrost.rst              | 18 ++++++++++++++++++
 4 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/ansible/bifrost.yml b/ansible/bifrost.yml
index a567ddfdcb..ad02f05398 100644
--- a/ansible/bifrost.yml
+++ b/ansible/bifrost.yml
@@ -1,6 +1,6 @@
 ---
 - name: Apply role bifrost
-  hosts: localhost
+  hosts: bifrost
   roles:
     - { role: bifrost,
         tags: bifrost}
diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one
index e42742d239..9e76b1288e 100644
--- a/ansible/inventory/all-in-one
+++ b/ansible/inventory/all-in-one
@@ -15,6 +15,9 @@ localhost       ansible_connection=local
 [monitoring]
 localhost       ansible_connection=local
 
+[deployment]
+localhost       ansible_connection=local
+
 # You can explicitly specify which hosts run each project by updating the
 # groups in the sections below. Common services are grouped together.
 [chrony-server:children]
@@ -178,6 +181,9 @@ control
 [placement:children]
 control
 
+[bifrost:children]
+deployment
+
 # Additional control implemented here. These groups allow you to control which
 # services run on which hosts at a per-service level.
 #
diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode
index 37484dc495..5e61b0c1f5 100644
--- a/ansible/inventory/multinode
+++ b/ansible/inventory/multinode
@@ -27,6 +27,9 @@ monitoring01
 [storage]
 storage01
 
+[deployment]
+localhost       ansible_connection=local
+
 [baremetal:children]
 control
 network
@@ -195,6 +198,9 @@ control
 [placement:children]
 control
 
+[bifrost:children]
+deployment
+
 # Additional control implemented here. These groups allow you to control which
 # services run on which hosts at a per-service level.
 #
diff --git a/doc/bifrost.rst b/doc/bifrost.rst
index 20c8fde0a3..a379de04af 100644
--- a/doc/bifrost.rst
+++ b/doc/bifrost.rst
@@ -82,6 +82,24 @@ Production
 
     kolla-build bifrost-deploy
 
+Prepare Kolla-Ansible Inventory
+===============================
+
+Kolla-ansible will deploy bifrost on the hosts in the ``bifrost`` Ansible
+group.  In the ``all-in-one`` and ``multinode`` inventory files, a ``bifrost``
+group is defined which contains all hosts in the ``deployment`` group.  This
+top level ``deployment`` group is intended to represent the host running the
+``bifrost_deploy`` container.  By default, this group contains ``localhost``.
+See `edit-inventory`_ for details on how to modify the Ansible inventory in a
+multinode deployment.
+
+Bifrost does not currently support running on multiple hosts so the ``bifrost``
+group should contain only a single host, however this is not enforced by
+kolla-ansible.  Bifrost manages a number of services that conflict with
+services deployed by kolla including OpenStack Ironic, MariaDB, RabbitMQ and
+(optionally) OpenStack Keystone.  These services should not be deployed on the
+host on which bifrost is deployed.
+
 Prepare bifrost configs
 =======================