From 7dcd491f85fe15a51e91ee2579905886bda555c8 Mon Sep 17 00:00:00 2001 From: Shade Talabi Date: Wed, 4 Dec 2024 16:17:59 -0800 Subject: [PATCH 1/5] Add FBS groups model --- .../fbs_groups/deleted_example_01.txt | 43 ++++++ .../fbs_groups/deleted_example_02.txt | 28 ++++ .../fbs_groups/merged_example_01.txt | 49 +++++++ .../fbs_groups/overridden_example_01.txt | 37 ++++++ .../fbs_groups/sonic_fbs_groups.yaml | 125 ++++++++++++++++++ 5 files changed, 282 insertions(+) create mode 100644 models/enterprise_sonic/fbs_groups/deleted_example_01.txt create mode 100644 models/enterprise_sonic/fbs_groups/deleted_example_02.txt create mode 100644 models/enterprise_sonic/fbs_groups/merged_example_01.txt create mode 100644 models/enterprise_sonic/fbs_groups/overridden_example_01.txt create mode 100644 models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml diff --git a/models/enterprise_sonic/fbs_groups/deleted_example_01.txt b/models/enterprise_sonic/fbs_groups/deleted_example_01.txt new file mode 100644 index 00000000..0fdfdc4b --- /dev/null +++ b/models/enterprise_sonic/fbs_groups/deleted_example_01.txt @@ -0,0 +1,43 @@ +# Using Deleted +# +# Before State: +# ------------- +# +# sonic# show running-configuration pbf next-hop-group +# ! +# pbf next-hop-group hop1 type ip +# description abc +# entry 1 next-hop 1.1.1.1 vrf VrfReg1 non-recursive +# ! +# sonic# show running-configuration pbf replication-group +# ! +# pbf replication-group rep1 type ipv6 +# description xyz +# entry 2 next-hop 1::1 vrf VrfReg2 overlay single-copy +# ! + +- name: Delete FBS groups configuration + dellemc.enterprise_sonic.sonic_fbs_groups: + config: + next_hop_groups: + - group_name: hop1 + group_description: abc + replication_groups: + - group_name: rep1 + next_hops: + - entry_id: 2 + state: deleted + +# After State: +# ------------ +# +# sonic# show running-configuration pbf next-hop-group +# ! +# pbf next-hop-group hop1 type ip +# entry 1 next-hop 1.1.1.1 vrf VrfReg1 non-recursive +# ! +# sonic# show running-configuration pbf replication-group +# ! +# pbf replication-group rep1 type ipv6 +# description xyz +# ! diff --git a/models/enterprise_sonic/fbs_groups/deleted_example_02.txt b/models/enterprise_sonic/fbs_groups/deleted_example_02.txt new file mode 100644 index 00000000..6a9010ce --- /dev/null +++ b/models/enterprise_sonic/fbs_groups/deleted_example_02.txt @@ -0,0 +1,28 @@ +# Using Deleted +# +# Before State: +# ------------- +# +# sonic# show running-configuration pbf next-hop-group +# ! +# pbf next-hop-group hop1 type ip +# entry 1 next-hop 1.1.1.1 vrf VrfReg1 non-recursive +# ! +# sonic# show running-configuration pbf replication-group +# ! +# pbf replication-group rep1 type ipv6 +# description xyz +# ! + +- name: Delete FBS groups configuration + dellemc.enterprise_sonic.sonic_fbs_groups: + config: + state: deleted + +# After State: +# ------------ +# +# sonic# show running-configuration pbf next-hop-group +# (No 'pbf next-hop-group' configuration present) +# sonic# show running-configuration pbf replication-group +# (No 'pbf replication-group' configuration present) diff --git a/models/enterprise_sonic/fbs_groups/merged_example_01.txt b/models/enterprise_sonic/fbs_groups/merged_example_01.txt new file mode 100644 index 00000000..c7afb599 --- /dev/null +++ b/models/enterprise_sonic/fbs_groups/merged_example_01.txt @@ -0,0 +1,49 @@ +# Using Merged +# +# Before State: +# ------------- +# +# sonic# show running-configuration pbf next-hop-group +# (No 'pbf next-hop-group' configuration present) +# sonic# show running-configuration pbf replication-group +# (No 'pbf replication-group' configuration present) + +- name: Merge FBS groups configuration + dellemc.enterprise_sonic.sonic_fbs_groups: + config: + next_hop_groups: + - group_name: hop1 + group_description: abc + group_type: ipv4 + next_hops: + - entry_id: 1 + ip_address: 1.1.1.1 + network_instance: VrfReg1 + next_hop_type: non_recursive + replication_groups: + - group_name: rep1 + group_description: xyz + group_type: ipv6 + next_hops: + - entry_id: 2 + ip_address: 1::1 + network_instance: VrfReg2 + next_hop_type: overlay + single_copy: true + state: merged + +# After State: +# ------------ +# +# sonic# show running-configuration pbf next-hop-group +# ! +# pbf next-hop-group hop1 type ip +# description abc +# entry 1 next-hop 1.1.1.1 vrf VrfReg1 non-recursive +# ! +# sonic# show running-configuration pbf replication-group +# ! +# pbf replication-group rep1 type ipv6 +# description xyz +# entry 2 next-hop 1::1 vrf VrfReg2 overlay single-copy +# ! diff --git a/models/enterprise_sonic/fbs_groups/overridden_example_01.txt b/models/enterprise_sonic/fbs_groups/overridden_example_01.txt new file mode 100644 index 00000000..3628cc74 --- /dev/null +++ b/models/enterprise_sonic/fbs_groups/overridden_example_01.txt @@ -0,0 +1,37 @@ +# Using Overridden +# +# Before State: +# ------------- +# +# sonic# show running-configuration pbf next-hop-group +# ! +# pbf next-hop-group hop1 type ip +# description abc +# entry 1 next-hop 1.1.1.1 vrf VrfReg1 non-recursive +# ! +# sonic# show running-configuration pbf replication-group +# ! +# pbf replication-group rep1 type ipv6 +# description xyz +# entry 2 next-hop 1::1 vrf VrfReg2 overlay single-copy +# ! + +- name: Override FBS groups configuration + dellemc.enterprise_sonic.sonic_fbs_groups: + config: + next_hop_groups: + - group_name: hop1 + group_description: abc + group_type: ipv4 + state: overridden + +# After State: +# ------------ +# +# sonic# show running-configuration pbf next-hop-group +# ! +# pbf next-hop-group hop1 type ip +# description abc +# ! +# sonic# show running-configuration pbf replication-group +# (No 'pbf replication-group' configuration present) diff --git a/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml b/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml new file mode 100644 index 00000000..661361fc --- /dev/null +++ b/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml @@ -0,0 +1,125 @@ +--- +GENERATOR_VERSION: '1.0' +NETWORK_OS: sonic +RESOURCE: mgmt_servers +COPYRIGHT: Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved +DOCUMENTATION: | + module: sonic_fbs_groups + version_added: 3.1.0 + notes: + - Tested against Enterprise SONiC Distribution by Dell Technologies. + - Supports C(check_mode). + short_description: Manage flow based services (FBS) groups configuration on SONiC + description: + - This module provides configuration management of FBS groups for devices running SONiC + author: Shade Talabi (@stalabi1) + options: + config: + description: + - FBS groups configuration + type: dict + suboptions: + next_hop_groups: + description: + - Next hop groups configuration + type: list + elements: dict + suboptions: + group_name: + description: + - Name of next hop group + type: str + required: true + group_description: + description: + - Description of group + type: str + group_type: + description: + - Type of next hop group + type: str + choices: ['ipv4', 'ipv6'] + next_hops: + description: + - Next hops configuration for forwarding + type: list + elements: dict + suboptions: + entry_id: + description: + - Entry ID, range 1-65535 + type: int + required: true + ip_address: + description: + - Forwarding IP address + type: str + network_instance: + description: + - Forwarding network instance + type: str + next_hop_type: + description: + - Type of next hop + type: str + choices: ['non_recursive', 'overlay', 'recursive'] + replication_groups: + description: + - Replication groups configuration + type: list + elements: dict + suboptions: + group_name: + description: + - Name of replication group + type: str + required: true + group_description: + description: + - Description of group + type: str + group_type: + description: + - Type of replication group + type: str + choices: ['ipv4', 'ipv6'] + next_hops: + description: + - Next hops configuration for forwarding + type: list + elements: dict + suboptions: + entry_id: + description: + - Entry ID, range 1-65535 + type: int + required: true + ip_address: + description: + - Forwarding IP address + type: str + network_instance: + description: + - Forwarding network instance + type: str + next_hop_type: + description: + - Type of next hop + type: str + choices: ['non_recursive', 'overlay', 'recursive'] + single_copy: + description: + - Enable/disable single path to create copy + type: bool + state: + description: + - The state of the configuration after module completion + - Replaced state is not supported for this module due to configuration constraints + type: str + choices: ['merged', 'deleted', 'overridden'] + default: merged +EXAMPLES: + - deleted_example_01.txt + - deleted_example_02.txt + - merged_example_01.txt + - overridden_example_01.txt From eae63b47078e7f293ab8e8aa8e79a80ee8bc9578 Mon Sep 17 00:00:00 2001 From: stalabi1 <54641848+stalabi1@users.noreply.github.com> Date: Wed, 4 Dec 2024 17:00:15 -0800 Subject: [PATCH 2/5] Update sonic_fbs_groups.yaml --- models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml b/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml index 661361fc..ede5acda 100644 --- a/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml +++ b/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml @@ -1,8 +1,8 @@ --- GENERATOR_VERSION: '1.0' NETWORK_OS: sonic -RESOURCE: mgmt_servers -COPYRIGHT: Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved +RESOURCE: fbs_groups +COPYRIGHT: Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved. DOCUMENTATION: | module: sonic_fbs_groups version_added: 3.1.0 From 8175529c16df91f32dbf6fbf2fb6c9ab30fae91b Mon Sep 17 00:00:00 2001 From: stalabi1 <54641848+stalabi1@users.noreply.github.com> Date: Wed, 8 Jan 2025 12:53:07 -0800 Subject: [PATCH 3/5] Update sonic_fbs_groups.yaml --- models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml b/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml index ede5acda..e29ddfa4 100644 --- a/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml +++ b/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml @@ -111,6 +111,7 @@ DOCUMENTATION: | description: - Enable/disable single path to create copy type: bool + choices: [true] state: description: - The state of the configuration after module completion From 88e174897bcbd8315074c678b2b7a9792d625d3a Mon Sep 17 00:00:00 2001 From: Shade Talabi Date: Tue, 21 Jan 2025 13:00:23 -0800 Subject: [PATCH 4/5] Update fbs groups model --- .../fbs_groups/deleted_example_01.txt | 6 +- .../fbs_groups/deleted_example_02.txt | 6 +- .../fbs_groups/merged_example_01.txt | 6 +- .../fbs_groups/overridden_example_01.txt | 6 +- .../fbs_groups/replaced_example_01.txt | 55 +++++++++++++++++++ .../fbs_groups/sonic_fbs_groups.yaml | 8 ++- 6 files changed, 73 insertions(+), 14 deletions(-) create mode 100644 models/enterprise_sonic/fbs_groups/replaced_example_01.txt diff --git a/models/enterprise_sonic/fbs_groups/deleted_example_01.txt b/models/enterprise_sonic/fbs_groups/deleted_example_01.txt index 0fdfdc4b..0b1391fd 100644 --- a/models/enterprise_sonic/fbs_groups/deleted_example_01.txt +++ b/models/enterprise_sonic/fbs_groups/deleted_example_01.txt @@ -1,6 +1,6 @@ -# Using Deleted +# Using "deleted" state # -# Before State: +# Before state: # ------------- # # sonic# show running-configuration pbf next-hop-group @@ -28,7 +28,7 @@ - entry_id: 2 state: deleted -# After State: +# After state: # ------------ # # sonic# show running-configuration pbf next-hop-group diff --git a/models/enterprise_sonic/fbs_groups/deleted_example_02.txt b/models/enterprise_sonic/fbs_groups/deleted_example_02.txt index 6a9010ce..6d76381b 100644 --- a/models/enterprise_sonic/fbs_groups/deleted_example_02.txt +++ b/models/enterprise_sonic/fbs_groups/deleted_example_02.txt @@ -1,6 +1,6 @@ -# Using Deleted +# Using "deleted" state # -# Before State: +# Before state: # ------------- # # sonic# show running-configuration pbf next-hop-group @@ -19,7 +19,7 @@ config: state: deleted -# After State: +# After state: # ------------ # # sonic# show running-configuration pbf next-hop-group diff --git a/models/enterprise_sonic/fbs_groups/merged_example_01.txt b/models/enterprise_sonic/fbs_groups/merged_example_01.txt index c7afb599..bf985ca4 100644 --- a/models/enterprise_sonic/fbs_groups/merged_example_01.txt +++ b/models/enterprise_sonic/fbs_groups/merged_example_01.txt @@ -1,6 +1,6 @@ -# Using Merged +# Using "merged" state # -# Before State: +# Before state: # ------------- # # sonic# show running-configuration pbf next-hop-group @@ -32,7 +32,7 @@ single_copy: true state: merged -# After State: +# After state: # ------------ # # sonic# show running-configuration pbf next-hop-group diff --git a/models/enterprise_sonic/fbs_groups/overridden_example_01.txt b/models/enterprise_sonic/fbs_groups/overridden_example_01.txt index 3628cc74..5a820f28 100644 --- a/models/enterprise_sonic/fbs_groups/overridden_example_01.txt +++ b/models/enterprise_sonic/fbs_groups/overridden_example_01.txt @@ -1,6 +1,6 @@ -# Using Overridden +# Using "overridden" state # -# Before State: +# Before state: # ------------- # # sonic# show running-configuration pbf next-hop-group @@ -25,7 +25,7 @@ group_type: ipv4 state: overridden -# After State: +# After state: # ------------ # # sonic# show running-configuration pbf next-hop-group diff --git a/models/enterprise_sonic/fbs_groups/replaced_example_01.txt b/models/enterprise_sonic/fbs_groups/replaced_example_01.txt new file mode 100644 index 00000000..8f7e0d04 --- /dev/null +++ b/models/enterprise_sonic/fbs_groups/replaced_example_01.txt @@ -0,0 +1,55 @@ +# Using "replaced" state +# +# Before state: +# ------------- +# +# sonic# show running-configuration pbf next-hop-group +# ! +# pbf next-hop-group hop1 type ip +# description abc +# entry 1 next-hop 1.1.1.1 vrf VrfReg1 non-recursive +# ! +# pbf next-hop-group hop2 type ipv6 +# description abc +# entry 5 next-hop 3::3 vrf default non-recursive +# ! +# sonic# show running-configuration pbf replication-group +# ! +# pbf replication-group rep1 type ipv6 +# description xyz +# entry 2 next-hop 1::1 vrf VrfReg2 overlay single-copy +# ! + +- name: Replace FBS groups configuration + dellemc.enterprise_sonic.sonic_fbs_groups: + config: + next_hop_groups: + - group_name: hop2 + group_description: xyz + group_type: ipv4 + next_hops: + - entry_id: 1 + ip_address: 1.1.1.1 + network_instance: VrfReg1 + next_hop_type: recursive + state: replaced + +# After state: +# ------------ +# +# sonic# show running-configuration pbf next-hop-group +# ! +# pbf next-hop-group hop1 type ip +# description abc +# entry 1 next-hop 1.1.1.1 vrf VrfReg1 non-recursive +# ! +# pbf next-hop-group hop2 type ipv4 +# description xyz +# entry 1 next-hop 1.1.1.1 vrf VrfReg1 recursive +# ! +# sonic# show running-configuration pbf replication-group +# ! +# pbf replication-group rep1 type ipv6 +# description xyz +# entry 2 next-hop 1::1 vrf VrfReg2 overlay single-copy +# ! diff --git a/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml b/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml index 661361fc..a51cc9e7 100644 --- a/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml +++ b/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml @@ -37,6 +37,7 @@ DOCUMENTATION: | group_type: description: - Type of next hop group + - The group type is required for merged, replaced, and overridden states. type: str choices: ['ipv4', 'ipv6'] next_hops: @@ -53,6 +54,7 @@ DOCUMENTATION: | ip_address: description: - Forwarding IP address + - The IP address is required for merged, replaced, and overridden states. type: str network_instance: description: @@ -81,6 +83,7 @@ DOCUMENTATION: | group_type: description: - Type of replication group + - The group type is required for merged, replaced, and overridden states. type: str choices: ['ipv4', 'ipv6'] next_hops: @@ -97,6 +100,7 @@ DOCUMENTATION: | ip_address: description: - Forwarding IP address + - The IP address is required for merged, replaced, and overridden states. type: str network_instance: description: @@ -114,12 +118,12 @@ DOCUMENTATION: | state: description: - The state of the configuration after module completion - - Replaced state is not supported for this module due to configuration constraints type: str - choices: ['merged', 'deleted', 'overridden'] + choices: ['merged', 'deleted', 'replaced', 'overridden'] default: merged EXAMPLES: - deleted_example_01.txt - deleted_example_02.txt - merged_example_01.txt - overridden_example_01.txt + - replaced_example_01.txt From be0961add16334ec4ae82429f8d4d5e9a9d7e544 Mon Sep 17 00:00:00 2001 From: stalabi1 <54641848+stalabi1@users.noreply.github.com> Date: Tue, 21 Jan 2025 13:02:41 -0800 Subject: [PATCH 5/5] Update copyright date --- models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml b/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml index 79331e46..125cb87d 100644 --- a/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml +++ b/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml @@ -2,7 +2,7 @@ GENERATOR_VERSION: '1.0' NETWORK_OS: sonic RESOURCE: fbs_groups -COPYRIGHT: Copyright 2024 Dell Inc. or its subsidiaries. All Rights Reserved. +COPYRIGHT: Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. DOCUMENTATION: | module: sonic_fbs_groups version_added: 3.1.0