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..0b1391fd --- /dev/null +++ b/models/enterprise_sonic/fbs_groups/deleted_example_01.txt @@ -0,0 +1,43 @@ +# Using "deleted" 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 +# ! +# 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..6d76381b --- /dev/null +++ b/models/enterprise_sonic/fbs_groups/deleted_example_02.txt @@ -0,0 +1,28 @@ +# Using "deleted" state +# +# 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..bf985ca4 --- /dev/null +++ b/models/enterprise_sonic/fbs_groups/merged_example_01.txt @@ -0,0 +1,49 @@ +# Using "merged" state +# +# 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..5a820f28 --- /dev/null +++ b/models/enterprise_sonic/fbs_groups/overridden_example_01.txt @@ -0,0 +1,37 @@ +# Using "overridden" 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 +# ! +# 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/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 new file mode 100644 index 00000000..125cb87d --- /dev/null +++ b/models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml @@ -0,0 +1,130 @@ +--- +GENERATOR_VERSION: '1.0' +NETWORK_OS: sonic +RESOURCE: fbs_groups +COPYRIGHT: Copyright 2025 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 + - The group type is required for merged, replaced, and overridden states. + 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 + - The IP address is required for merged, replaced, and overridden states. + 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 + - The group type is required for merged, replaced, and overridden states. + 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 + - The IP address is required for merged, replaced, and overridden states. + 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 + choices: [true] + state: + description: + - The state of the configuration after module completion + type: str + 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