Skip to content

Commit

Permalink
Add support for dellos10 switch configuration
Browse files Browse the repository at this point in the history
Change-Id: I2823016294e7df63f63be9ab26535b3962a71ebe
(cherry picked from commit 1fbb5cb)
  • Loading branch information
jovial authored and markgoddard committed Jun 20, 2022
1 parent 969bfef commit d5fb949
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 12 deletions.
3 changes: 2 additions & 1 deletion ansible/physical-network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- arista
- dellos6
- dellos9
- dellos10
- dell-powerconnect
- junos
- mellanox
Expand Down Expand Up @@ -111,7 +112,7 @@
arista_switch_interface_config: "{{ switch_interface_config }}"

- name: Ensure DellOS physical switches are configured
hosts: switches_of_type_dellos6:switches_of_type_dellos9:&switches_in_display_mode_False
hosts: switches_of_type_dellos6:switches_of_type_dellos9:switches_of_type_dellos10:&switches_in_display_mode_False
gather_facts: no
roles:
- role: ssh-known-host
Expand Down
11 changes: 6 additions & 5 deletions ansible/roles/dell-switch/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Dell Switch
===========

This role configures Dell switches using the `dellos6` or `dellos9` Ansible
modules. It provides a fairly minimal abstraction of the configuration
interface provided by the `dellos` modules, allowing for application of
arbitrary switch configuration options.
This role configures Dell switches using the `dellos6`, `dellos9`, or
`dellos10` Ansible modules. It provides a fairly minimal abstraction of the
configuration interface provided by the `dellos` modules, allowing for
application of arbitrary switch configuration options.

Requirements
------------
Expand All @@ -14,7 +14,8 @@ The switches should be configured to allow SSH access.
Role Variables
--------------

`dell_switch_type` is the type of Dell switch. One of `dellos6`, `dellos9`.
`dell_switch_type` is the type of Dell switch. One of `dellos6`, `dellos9`, or
`dellos10`.

`dell_switch_provider` is authentication provider information passed as the
`provider` argument to the `dellos` modules.
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/dell-switch/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# Type of Dell switch. One of dellos6, dellos9.
# Type of Dell switch. One of dellos6, dellos9, or dellos10.
dell_switch_type:

# Authentication provider information.
Expand Down
7 changes: 7 additions & 0 deletions ansible/roles/dell-switch/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@
provider: "{{ dell_switch_provider }}"
src: dellos9-config.j2
when: dell_switch_type == 'dellos9'

- name: Ensure DellOS10 switches are configured
local_action:
module: dellos10_config
provider: "{{ dell_switch_provider }}"
src: "{{ lookup('template', 'dellos10-config.j2') }}"
when: dell_switch_type == 'dellos10'
16 changes: 16 additions & 0 deletions ansible/roles/dell-switch/templates/dellos10-config.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#jinja2: trim_blocks: True,lstrip_blocks: True

{% for line in dell_switch_config %}
{{ line }}
{% endfor %}

{% for interface, config in dell_switch_interface_config.items() %}
interface {{ interface }}
{% if config.description is defined %}
description {{ config.description }}
{% endif %}
{% for line in config.config %}
{{ line }}
{% endfor %}
exit
{% endfor %}
11 changes: 6 additions & 5 deletions doc/source/configuration/reference/physical-network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The following switch operating systems are currently supported:
<https://docs.nvidia.com/networking-ethernet-software/cumulus-linux-44/System-Configuration/Network-Command-Line-Utility-NCLU/>`__)
* Dell OS 6
* Dell OS 9
* Dell OS 10
* Dell PowerConnect
* Juniper Junos OS
* Mellanox MLNX OS
Expand Down Expand Up @@ -192,13 +193,13 @@ default connection parameters used by Ansible:

* ``ansible_user`` is the SSH username.

Dell OS6 and OS9
----------------
Dell OS6, OS9, and OS10
-----------------------

Configuration for these devices is applied using the ``dellos6_config`` and
``dellos9_config`` Ansible modules.
Configuration for these devices is applied using the ``dellos6_config``,
``dellos9_config``, and ``dellos10_config`` Ansible modules.

``switch_type`` should be set to ``dellos6`` or ``dellos9``.
``switch_type`` should be set to ``dellos6``, ``dellos9``, or ``dellos10``.

Provider
^^^^^^^^
Expand Down
6 changes: 6 additions & 0 deletions releasenotes/notes/dellos10-support-31e209bcdb45552a.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
features:
- |
Adds support for configuring Dell OS10 Switches using the `dellemc.os10
Ansible collection <https://galaxy.ansible.com/dellemc/os10>`__. This is
integrated with the ``kayobe physical network configure`` command.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ PyYAML>=3.10.0 # MIT
selinux # MIT
# INI parsing
oslo.config>=5.2.0 # Apache-2.0
paramiko # LGPL
4 changes: 4 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
collections:
- name: dellemc.os10
version: 1.1.1

roles:
- src: ahuffman.resolv
version: 1.3.1
Expand Down

0 comments on commit d5fb949

Please sign in to comment.