Skip to content

Commit

Permalink
Merge pull request #306 from stackhpc/2024.1-chery-picks
Browse files Browse the repository at this point in the history
Apply 2024.1 backports from 2023.1
  • Loading branch information
markgoddard authored Jul 3, 2024
2 parents 9ede0ff + c718cf2 commit fc6fe6d
Show file tree
Hide file tree
Showing 13 changed files with 147 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ansible/inventory/group_vars/all/kolla
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ overcloud_container_image_regex_map:
enabled: "{{ kolla_enable_barbican | bool }}"
- regex: ^blazar
enabled: "{{ kolla_enable_blazar | bool }}"
- regex: ^caso
enabled: "{{ kolla_enable_caso | bool }}"
- regex: ^ceilometer
enabled: "{{ kolla_enable_ceilometer | bool }}"
- regex: ^cinder
Expand Down Expand Up @@ -508,6 +510,7 @@ kolla_enable_rabbitmq: "yes"
kolla_enable_aodh: "no"
kolla_enable_barbican: "no"
kolla_enable_blazar: "no"
kolla_enable_caso: "no"
kolla_enable_ceilometer: "no"
kolla_enable_central_logging: "no"
kolla_enable_cinder: "no"
Expand Down
13 changes: 13 additions & 0 deletions ansible/physical-network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- junos
- mellanox
- nclu
- nvue
- openvswitch
tasks:
- name: Fail if both interface name and description limits are specified
Expand Down Expand Up @@ -202,3 +203,15 @@
- role: nclu-switch
nclu_switch_config: "{{ switch_config }}"
nclu_switch_interface_config: "{{ switch_interface_config }}"

- name: Ensure Cumulus physical switches are configured with NVUE
hosts: switches_of_type_nvue:&switches_in_display_mode_False
gather_facts: no
roles:
- role: ssh-known-host

- role: nvue-switch
nvue_switch_config: "{{ switch_config }}"
nvue_switch_interface_config: "{{ switch_interface_config }}"
# TODO:
nvue_switch_save: false
3 changes: 3 additions & 0 deletions ansible/roles/kolla-ansible/templates/overcloud-components.j2
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,6 @@ monitoring

[letsencrypt:children]
loadbalancer

[caso:children]
monitoring
1 change: 1 addition & 0 deletions ansible/roles/kolla-ansible/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ kolla_feature_flags:
- aodh
- barbican
- blazar
- caso
- ceilometer
- ceilometer_horizon_policy_file
- ceilometer_ipmi
Expand Down
73 changes: 73 additions & 0 deletions ansible/roles/nvue-switch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
NVUE Switch
===========

This role configures Cumulus switches using the `nvidia.nvue.command` Ansible
module. It provides a fairly minimal abstraction of the configuration interface
provided by the `nvidia.nvue.command` module, allowing for application of
arbitrary switch configuration options.

Requirements
------------

The switches should be configured to allow SSH access.

Role Variables
--------------

`nvue_switch_config` is a list of NVUE commands to apply to the switch, and
defaults to an empty list. Commands must be formatted without the `nv` prefix,
which is added by the `nvidia.nvue.command` module before execution on the
switch.

`nvue_switch_interface_config` contains interface configuration. It is a dict
mapping switch interface names to configuration dicts. Interfaces can be switch
physical interfaces, but also special interfaces such as bridges or bonds. Each
dict may contain the following items:

- `description` - a description to apply to the interface.
- `config` - a list of per-interface configuration, each applied with a `nv
set interface <interface-name>` prefix.

Dependencies
------------

None

Example Playbook
----------------

The following playbook configures hosts in the `nvue-switches` group. It
applies global configuration to configure a BGP AS and add two EBGP neighbors
using BGP Unnumbered, enables two host interfaces with jumbo frames, and
attaches them to a traditional bridge called `bridge1` configured with an IP
address.

---
- name: Ensure Cumulus switches are configured with NVUE
hosts: nvue-switches
gather_facts: no
roles:
- role: nvue-switch
nvue_switch_config:
- "set router bgp autonomous-system 65000"
- "set router bgp neighbor swp51 interface remote-as external"
- "set router bgp neighbor swp52 interface remote-as external"
nvue_switch_interface_config:
swp1:
description: server1
config:
- "link mtu 9000"
swp2:
description: server2
config:
- "link mtu 9000"
bridge1:
config:
- "ip address 10.100.100.1/24"
- "ports swp1"
- "ports swp2"

Author Information
------------------

- Michal Nasiadka (<[email protected]>)
11 changes: 11 additions & 0 deletions ansible/roles/nvue-switch/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
# List of configuration lines to apply to the switch.
nvue_switch_config: []

# Interface configuration. Dict mapping switch interface names to configuration
# dicts. Each dict contains a 'description' item and a 'config' item which
# should contain a list of per-interface configuration.
nvue_switch_interface_config: {}

# Whether to save the NVUE configuration to disk.
nvue_switch_save: false
7 changes: 7 additions & 0 deletions ansible/roles/nvue-switch/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Ensure Cumulus switches are configured with NVUE
nvidia.nvue.command:
assume_yes: true
atomic: true
save: "{{ nvue_switch_save | bool }}"
template: "{{ lookup('template', 'nvue-config.j2') }}"
12 changes: 12 additions & 0 deletions ansible/roles/nvue-switch/templates/nvue-config.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#jinja2: trim_blocks: True,lstrip_blocks: True
{% for line in nvue_switch_config %}
{{ line }}
{% endfor %}
{% for interface, config in nvue_switch_interface_config.items() %}
{% for line in config.config %}
set interface {{ interface }} {{ line }}
{% endfor %}
{% if config.description is defined %}
set interface {{ interface }} description {{ config.description }}
{% endif %}
{% endfor %}
2 changes: 1 addition & 1 deletion doc/source/configuration/reference/hosts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1414,4 +1414,4 @@ using journald defaults). See `journald documentation
for more details.

Should you wish to disable this feature, you can set ``journald_storage`` to
``volatile``.
``volatile``.
15 changes: 13 additions & 2 deletions doc/source/configuration/reference/physical-network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ The following switch operating systems are currently supported:
* Arista EOS
* Cumulus Linux (via `Network Command Line Utility (NCLU)
<https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-44/System-Configuration/Network-Command-Line-Utility-NCLU/>`__)
* Cumulus Linux (via `NVIDIA User Experience command line utility (NVUE)
<https://docs.nvidia.com/networking-ethernet-software/cumulus-linux/System-Configuration/NVIDIA-User-Experience-NVUE/>`__)
* Dell OS 6
* Dell OS 9
* Dell OS 10
Expand Down Expand Up @@ -211,11 +213,20 @@ Configuration for these devices is applied using the ``nclu`` Ansible module.

``switch_type`` should be set to ``nclu``.

Cumulus Linux (with NVUE)
-------------------------

Configuration for these devices is applied using the ``nvidia.nvue.command``
Ansible module.

``switch_type`` should be set to ``nvue``.

SSH configuration
^^^^^^^^^^^^^^^^^

As with any non-switch host in the inventory, the ``nclu`` module relies on the
default connection parameters used by Ansible:
As with any non-switch host in the inventory, the ``nclu`` and
``nvidia.nvue.command`` modules rely on the default connection parameters used
by Ansible:

* ``ansible_host`` is the hostname or IP address. Optional.

Expand Down
1 change: 1 addition & 0 deletions kayobe/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,7 @@ def take_action(self, parsed_args):
playbooks = _build_playbook_list("network-connectivity")
self.run_kayobe_playbooks(parsed_args, playbooks)


class BaremetalComputeRegister(KayobeAnsibleMixin, VaultMixin, Command):
"""Register baremetal compute nodes in Ironic."""

Expand Down
7 changes: 7 additions & 0 deletions releasenotes/notes/cumulus-nvue-switch-9f52d701f6c49712.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
features:
- |
Adds support for configuring Cumulus switches using the `NVIDIA User
Experience command line utility (NVUE)
<https://docs.nvidia.com/networking-ethernet-software/cumulus-linux/System-Configuration/NVIDIA-User-Experience-NVUE/>`__.
This is integrated with the ``kayobe physical network configure`` command.
2 changes: 2 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ collections:
version: 1.0.0
- name: stackhpc.openstack
version: 0.2.1
- name: nvidia.nvue
version: 1.2.0

roles:
- src: ahuffman.resolv
Expand Down

0 comments on commit fc6fe6d

Please sign in to comment.