Add option to disable container builds on specific hosts

This change adds an option to disable any and all containers within a given host
The new option "no_containers" is a boolean option and has a default value of
false. When set true no containers will be created in inventory for a given machine.

This will allow deployers to simply disable container builds on specific machines
when nessisary. This is usefule when a deployer simply wants to deploy openstack
in a flattened environment. This has also been useful in cases where
infrastructure hosts may reside within virtualization solutions like OpenStack,
VirtualBox, or VMWare which implement strong port security rules which makes
container networking difficult or impossible.

To implement the change simply add the "no_containers: true|false" option to
a host entry in the openstack_user_config.yml

Change-Id: I8bed3e498a431e2683956e1009d9d9ece9fdb272
Signed-off-by: Kevin Carter <kevin@cloudnull.com>
This commit is contained in:
Kevin Carter 2019-02-08 22:38:43 -06:00 committed by Kevin Carter (cloudnull)
parent cb6daaa9cc
commit 9229315a1a
2 changed files with 21 additions and 0 deletions

View File

@ -354,6 +354,9 @@ def _add_container_hosts(assignment, config, container_name, container_type,
# Get any set host options # Get any set host options
host_options = config[physical_host_type][host_type] host_options = config[physical_host_type][host_type]
affinity = host_options.get('affinity', {}) affinity = host_options.get('affinity', {})
no_containers = host_options.get('no_containers', False)
if no_containers:
properties['is_metal'] = True
container_affinity = affinity.get(container_name, 1) container_affinity = affinity.get(container_name, 1)
# Ensures that container names are not longer than 63 # Ensures that container names are not longer than 63

View File

@ -0,0 +1,18 @@
---
features:
- |
A new option has been added allowing deployers to disable any and all
containers on a given host. The option `no_containers` is a boolean
which, if undefined, will default to *false*. This option can be added
to any host in the `openstack_user_config.yml` or via an override in
`conf.d`. When this option is set to *true* the given host will be
treated as a baremetal machine. The new option mirrors the existing
environmental option `is_metal` but allows deployers to target
specific hosts instead of entire groups.
.. code-block:: yaml
log_hosts:
infra-1:
ip: 172.16.24.2
no_containers: true