Merge "switches: add flag to save configuration on Dell switches"

This commit is contained in:
Zuul 2023-12-01 02:22:16 +00:00 committed by Gerrit Code Review
commit 8e82a6b4a6
6 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,3 @@
---
# Whether to save switch configuration after it has been applied.
switch_config_save: false

View File

@ -122,6 +122,7 @@
dell_switch_provider: "{{ switch_dellos_provider }}" dell_switch_provider: "{{ switch_dellos_provider }}"
dell_switch_config: "{{ switch_config }}" dell_switch_config: "{{ switch_config }}"
dell_switch_interface_config: "{{ switch_interface_config }}" dell_switch_interface_config: "{{ switch_interface_config }}"
dell_switch_save: "{{ switch_config_save }}"
- name: Ensure Dell PowerConnect physical switches are configured - name: Ensure Dell PowerConnect physical switches are configured
hosts: switches_of_type_dell-powerconnect:&switches_in_display_mode_False hosts: switches_of_type_dell-powerconnect:&switches_in_display_mode_False

View File

@ -12,3 +12,6 @@ dell_switch_config: []
# dicts. Each dict contains a 'description' item and a 'config' item which # dicts. Each dict contains a 'description' item and a 'config' item which
# should contain a list of per-interface configuration. # should contain a list of per-interface configuration.
dell_switch_interface_config: {} dell_switch_interface_config: {}
# Whether to save the configuration.
dell_switch_save: false

View File

@ -4,6 +4,7 @@
module: dellos6_config module: dellos6_config
provider: "{{ dell_switch_provider }}" provider: "{{ dell_switch_provider }}"
src: dellos6-config.j2 src: dellos6-config.j2
save: "{{ dell_switch_save | bool }}"
when: dell_switch_type == 'dellos6' when: dell_switch_type == 'dellos6'
- name: Ensure DellOS9 switches are configured - name: Ensure DellOS9 switches are configured
@ -11,6 +12,7 @@
module: dellos9_config module: dellos9_config
provider: "{{ dell_switch_provider }}" provider: "{{ dell_switch_provider }}"
src: dellos9-config.j2 src: dellos9-config.j2
save: "{{ dell_switch_save | bool }}"
when: dell_switch_type == 'dellos9' when: dell_switch_type == 'dellos9'
- name: Ensure DellOS10 switches are configured - name: Ensure DellOS10 switches are configured
@ -18,4 +20,5 @@
module: dellos10_config module: dellos10_config
provider: "{{ dell_switch_provider }}" provider: "{{ dell_switch_provider }}"
src: "{{ lookup('template', 'dellos10-config.j2') }}" src: "{{ lookup('template', 'dellos10-config.j2') }}"
save: "{{ dell_switch_save | bool }}"
when: dell_switch_type == 'dellos10' when: dell_switch_type == 'dellos10'

View File

@ -229,6 +229,9 @@ Configuration for these devices is applied using the ``dellos6_config``,
``switch_type`` should be set to ``dellos6``, ``dellos9``, or ``dellos10``. ``switch_type`` should be set to ``dellos6``, ``dellos9``, or ``dellos10``.
``switch_config_save`` may be set to ``true`` to enable saving configuration
after it has been applied.
Provider Provider
^^^^^^^^ ^^^^^^^^

View File

@ -0,0 +1,6 @@
---
features:
- |
Adds support for saving configuration to switches when running ``kayobe
physical network configure``. Currently only supported on Dell OS9 and OS10
devices.