Separate physical configuration for discovery

After discovery Neutron needs to own the control of ports for the baremetal compute
nodes. We separate the interface configuration and add an --enable-discovery flag
to kayobe physical network configure
This commit is contained in:
Mark Goddard 2017-04-03 12:08:51 +01:00
parent 92c97463af
commit 65ed0da197
4 changed files with 25 additions and 2 deletions

View File

@ -17,3 +17,8 @@ switch_config: []
# Generally this should be configured on a per-switch basis via a host_vars
# file.
switch_interface_config: {}
# Interface configuration for hardware discovery. After discovery Neutron owns
# the configuration of these ports. Has the same format as
# switch_interface_config.
switch_interface_config_discovery: {}

View File

@ -5,11 +5,20 @@
- name: Group hosts by their switch type
hosts: switches
gather_facts: no
vars:
# Set this variable to True to configure of network for hardware discovery.
physical_network_enable_discovery: False
tasks:
- name: Group hosts by their switch type
group_by:
key: "switches_of_type_{{ switch_type }}"
- name: Add discovery interface configuration when performing discovery
set_fact:
switch_interface_config: >
{{ switch_interface_config | combine(switch_interface_config_discovery) }}
when: "{{ physical_network_enable_discovery | bool }}"
- name: Ensure DellOS physical switches are configured
hosts: switches_of_type_dellos6:switches_of_type_dellos9
gather_facts: no

View File

@ -151,11 +151,15 @@ modules. Currently Dell Network OS 6 and Dell Network OS 9 switches are
supported but this could easily be extended. To provision the physical
network::
(kayobe-venv) $ kayobe physical network configure --group <group>
(kayobe-venv) $ kayobe physical network configure --group <group> [--enable-discovery]
The ``--group`` argument is used to specify an Ansible group containing
the switches to be configured.
The ``--enable-discovery`` argument enables a one-time configuration of ports
attached to baremetal compute nodes to support hardware discovery via ironic
inspector.
Seed
====

View File

@ -136,12 +136,17 @@ class PhysicalNetworkConfigure(KayobeAnsibleMixin, Command):
group = parser.add_argument_group("Physical Networking")
group.add_argument("--group", required=True,
help="the Ansible group to apply configuration to")
group.add_argument("--enable-discovery", action="store_true",
help="configure the network for hardware discovery")
return parser
def take_action(self, parsed_args):
self.app.LOG.debug("Configuring a physical network")
extra_vars = {}
if parsed_args.enable_discovery:
extra_vars["physical_network_enable_discovery"] = True
ansible.run_playbook(parsed_args, "ansible/physical-network.yml",
limit=parsed_args.group)
limit=parsed_args.group, extra_vars=extra_vars)
class SeedVMProvision(KollaAnsibleMixin, KayobeAnsibleMixin, Command):