Skip to content

Add FBS groups model #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions models/enterprise_sonic/fbs_groups/deleted_example_01.txt
Original file line number Diff line number Diff line change
@@ -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
# !
28 changes: 28 additions & 0 deletions models/enterprise_sonic/fbs_groups/deleted_example_02.txt
Original file line number Diff line number Diff line change
@@ -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)
49 changes: 49 additions & 0 deletions models/enterprise_sonic/fbs_groups/merged_example_01.txt
Original file line number Diff line number Diff line change
@@ -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
# !
37 changes: 37 additions & 0 deletions models/enterprise_sonic/fbs_groups/overridden_example_01.txt
Original file line number Diff line number Diff line change
@@ -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)
55 changes: 55 additions & 0 deletions models/enterprise_sonic/fbs_groups/replaced_example_01.txt
Original file line number Diff line number Diff line change
@@ -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
# !
130 changes: 130 additions & 0 deletions models/enterprise_sonic/fbs_groups/sonic_fbs_groups.yaml
Original file line number Diff line number Diff line change
@@ -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