Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/README.md

raw symbols SCIP
1 Ansible Network Collection for Enterprise SONiC Distribution by Dell Technologies
2 =================================================================================
3
4 This collection includes Ansible core modules, network resource modules, and plugins needed to provision and manage Dell EMC PowerSwitch platforms running Enterprise SONiC Distribution by Dell Technologies. Sample playbooks and documentation are also included to show how the collection can be used.
5
6 Supported connections
7 ---------------------
8 The SONiC Ansible collection supports network_cli and httpapi connections.
9
10 Plugins
11 --------
12 **CLICONF plugin**
13
14 Name | Description
15 --- | ---
16 [network_cli](https://github.com/ansible-collections/dellemc.enterprise_sonic)|Use Ansible CLICONF to run commands on Enterprise SONiC
17
18 **HTTPAPI plugin**
19
20 Name | Description
21 --- | ---
22 [httpapi](https://github.com/ansible-collections/dellemc.enterprise_sonic)|Use Ansible HTTPAPI to run commands on Enterprise SONiC
23
24 Collection core modules
25 ------------------------
26 Name | Description | Connection type
27 --- | --- | ---
28 [**sonic_command**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_command_module.rst)|Run commands through the Management Framework CLI|network_cli
29 [**sonic_config**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_config_module.rst)|Manage configuration through the Management Framework CLI|network_cli
30 [**sonic_api**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_api_module.rst)|Perform REST operations through the Management Framework REST API|httpapi
31 [**sonic_facts**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_facts_module.rst)|Collect "facts" (configuration) in argspec format for selected modules|httpapi
32
33 Collection network resource modules
34 -----------------------------------
35 Listed are the SONiC Ansible network resource modules which need ***httpapi*** as the connection type. Supported operations are ***merged***, ***deleted***, ***replaced*** and ***overridden***.
36
37 Name | Description
38 --- | ---
39 [**sonic_aaa**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_aaa_module.rst)| Manage AAA and its parameters
40 [**sonic_acl_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_acl_interfaces_module.rst)| Manage access control list (ACL) to interface binding
41 [**sonic_ars**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ars_module.rst)| Manage adaptive routing and switching (ARS) configuration on SONiC
42 [**sonic_bfd**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_bfd_module.rst)| Manage BFD configuration
43 [**sonic_bgp**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_bgp_module.rst)| Manage global BGP and its parameters
44 [**sonic_bgp_af**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_bgp_af_module.rst)| Manage global BGP address-family and its parameters
45 [**sonic_bgp_as_paths**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_bgp_as_paths_module.rst)| Manage BGP autonomous system path (or as-path-list) and its parameters
46 [**sonic_bgp_communities**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_bgp_communities_module.rst)| Manage BGP community and its parameters
47 [**sonic_bgp_ext_communities**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_bgp_ext_communities_module.rst)| Manage BGP extended community-list and its parameters
48 [**sonic_bgp_neighbors**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_bgp_neighbors_module.rst)| Manage a BGP neighbor and its parameters
49 [**sonic_bgp_neighbors_af**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_bgp_neighbors_af_module.rst)| Manage the BGP neighbor address-family and its parameters
50 [**sonic_br_l2pt**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_br_l2pt_module.rst)| Manage L2PT configurations on SONiC
51 [**sonic_copp**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_copp_module.rst)| Manage CoPP configuration
52 [**sonic_dcbx**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_dcbx_module.rst)| Manage DCBx configurations on SONiC
53 [**sonic_dhcp_relay**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_dhcp_relay_module.rst)| Manage DHCP and DHCPv6 relay configurations
54 [**sonic_dhcp_snooping**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_dhcp_snooping_module.rst)| Manage DHCP Snooping
55 [**sonic_drop_counter**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_drop_counter_module.rst)| Manage drop counter configuration on SONiC
56 [**sonic_ecmp_load_share**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ecmp_load_share_module.rst)| IP ECMP load share mode configuration handling for SONiC
57 [**sonic_evpn_esi_multihome**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_evpn_esi_multihome_module.rst)| Manage EVPN ESI multihoming configuration on SONiC
58 [**sonic_fbs_classifiers**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_fbs_classifiers_module.rst)| Manage flow based services (FBS) classifiers configuration on SONiC
59 [**sonic_fbs_groups**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_fbs_groups_module.rst)| Manage flow based services (FBS) groups configuration on SONiC
60 [**sonic_fbs_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_fbs_interfaces_module.rst)| Manage flow based services (FBS) interfaces configuration on SONiC
61 [**sonic_fbs_policies**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_fbs_policies_module.rst)| Manage flow based services (FBS) policies configuration on SONiC
62 [**sonic_fips**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_fips_module.rst)| Manage FIPS configurations
63 [**sonic_image_management**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_image_management_module.rst)| Manage installation of Enterprise SONiC image, software patch and firmware updater.
64 [**sonic_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_interfaces_module.rst)| Configure Interface attributes
65 [**sonic_ip_neighbor**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ip_neighbor_module.rst)| Manage IP neighbor global configuration
66 [**sonic_ip_neighbor_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ip_neighbor_interfaces_module.rst)| Manage interface-specific IP neighbor configurations on SONiC
67 [**sonic_ipv6_router_advertisement**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ipv6_router_advertisement_module.rst)| Manage interface-specific IPv6 Router Advertisement configurations on SONiC
68 [**sonic_l2_acls**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_l2_acls_module.rst)| Manage Layer 2 access control lists (ACL) configurations
69 [**sonic_l2_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_l2_interfaces_module.rst)| Configure interface-to-VLAN association
70 [**sonic_l3_acls**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_l3_acls_module.rst)| Manage Layer 3 access control lists (ACL) configurations
71 [**sonic_l3_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_l3_interfaces_module.rst)| Configure the IPv4 and IPv6 parameters on Interfaces
72 [**sonic_lag_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_lag_interfaces_module.rst)| Manage link aggregation group (LAG) interface parameters
73 [**sonic_ldap**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ldap_module.rst)| Configure global LDAP server settings
74 [**sonic_lldp_global**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_lldp_global_module.rst)| Manage Global LLDP configurations
75 [**sonic_lldp_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_lldp_interfaces_module.rst)| Manage interface LLDP configurations
76 [**sonic_logging**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_logging_module.rst)| Manage logging configuration
77 [**sonic_login_lockout**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_login_lockout_module.rst)| Manage Global Login Lockout configuration
78 [**sonic_lst**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_lst_module.rst)| Manage link state tracking (LST) configuration on SONiC
79 [**sonic_mac**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_mac_module.rst)| Manage MAC configuration
80 [**sonic_mclag**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_mclag_module.rst)| Manage multi chassis link aggregation groups domain (MCLAG) and its parameters
81 [**sonic_mfa**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_mfa_module.rst)| Manage Multi-factor authentication (MFA) configurations on SONiC
82 [**sonic_mgmt_servers**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_mgmt_servers_module.rst)| Manage management servers configuration
83 [**sonic_mirroring**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_mirroring_module.rst)| Manage port mirroring configuration on SONiC
84 [**sonic_network_policy**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_network_policy_module.rst)| Manage network policy configuration on SONiC
85 [**sonic_ntp**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ntp_module.rst)| Manage NTP configuration
86 [**sonic_ospf_area**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ospf_area_module.rst)| Configure OSPF area setting
87 [**sonic_ospfv2**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ospfv2_module.rst)| Configure global OSPFv2 protocol settings
88 [**sonic_ospfv2_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ospfv2_interfaces_module.rst)| Configure OSPFv2 interface mode protocol settings
89 [**sonic_ospfv3**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ospfv3_module.rst)| Configure global OSPFv3 protocol settings on SONiC
90 [**sonic_ospfv3_area**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ospfv3_area_module.rst)| Configure OSPFv3 area settings on SONiC
91 [**sonic_ospfv3_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ospfv3_interfaces_module.rst)| Configure OSPFv3 interface mode protocol settings on SONiC
92 [**sonic_pim_global**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_pim_global_module.rst)| Manage global PIM configuration
93 [**sonic_pim_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_pim_interfaces_module.rst)| Manage interface-specific PIM configurations
94 [**sonic_pki**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_pki_module.rst)| Manages PKI attributes
95 [**sonic_pms**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_pms_module.rst)| Configure interface mode port security settings on SONiC
96 [**sonic_poe**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_poe_module.rst)| Manage Power over Ethernet PoE configuration
97 [**sonic_port_breakout**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_port_breakout_module.rst)| Configure port breakout settings on physical interfaces
98 [**sonic_port_group**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_port_group_module.rst)| Manage port group configuration
99 [**sonic_prefix_lists**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_prefix_lists_module.rst)| Manage prefix list configuration
100 [**sonic_ptp_default_ds**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ptp_default_ds_module.rst)| Manage global PTP configurations on SONiC
101 [**sonic_ptp_port_ds**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ptp_port_ds_module.rst)| Manage port specific PTP configurations on SONiC
102 [**sonic_qos_buffer**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_qos_buffer_module.rst)| Manage QoS buffer configuration
103 [**sonic_qos_interfaces**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_qos_interfaces_module.rst)| Manage QoS interfaces configuration
104 [**sonic_qos_maps**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_qos_maps_module.rst)| Manage QoS maps configuration
105 [**sonic_qos_pfc**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_qos_pfc_module.rst)| Manage QoS PFC configuration
106 [**sonic_qos_scheduler**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_qos_scheduler_module.rst)| Manage QoS scheduler configuration
107 [**sonic_qos_wred**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_qos_wred_module.rst)| Manage QoS WRED profiles configuration
108 [**sonic_radius_server**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_radius_server_module.rst)| Manage RADIUS server and its parameters
109 [**sonic_roce**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_roce_module.rst)| Manage RoCE QoS configuration
110 [**sonic_route_maps**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_route_maps_module.rst)| Manage route map configuration
111 [**sonic_sflow**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_sflow_module.rst)| Manage sflow configuration settings
112 [**sonic_ssh**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ssh_module.rst)| Manage SSH configuration settings
113 [**sonic_ssh_server**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_ssh_server_module.rst)| Manage SSH server configurations on SONiC
114 [**sonic_static_routes**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_static_routes_module.rst)| Manage static routes configuration
115 [**sonic_stp**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_stp_module.rst)| Manage STP configuration
116 [**sonic_system**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_system_module.rst)| Configure system parameters
117 [**sonic_tacacs_server**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_tacacs_server_module.rst)| Manage TACACS server and its parameters
118 [**sonic_users**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_users_module.rst)| Manage users and its parameters
119 [**sonic_vlan_mapping**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_vlan_mapping_module.rst)| Configure vlan mappings
120 [**sonic_vlans**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_vlans_module.rst)| Manage VLAN and its parameters
121 [**sonic_vrfs**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_vrfs_module.rst)| Manage VRFs and associate VRFs to interfaces
122 [**sonic_vrrp**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_vrrp_module.rst)| Manage VRRP protocol configuration settings
123 [**sonic_vxlans**](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/docs/dellemc.enterprise_sonic.sonic_vxlans_module.rst)| Manage VxLAN EVPN and its parameters
124
125 Sample use case playbooks
126 -------------------------
127 The playbooks directory includes this sample playbook that shows end-to-end use cases.
128
129 Name | Description
130 --- | ---
131 [**BGP Layer 3 fabric**](https://github.com/ansible-collections/dellemc.enterprise_sonic/tree/master/playbooks/bgp_l3_fabric)|Example playbook to build a Layer 3 leaf-spine fabric
132
133 Version compatibility
134 ----------------------
135 * Recommended Ansible version 2.17 or higher (This is required for enterprise_sonic collection version >= 3.2.0).
136 * Enterprise SONiC Distribution by Dell Technologies version 3.1 or higher
137 * Recommended Python 3.10 or higher (This is required for enterprise_sonic collection version >= 3.2.0.).
138 * Dell Enterprise SONiC images for releases 3.1 - 3.5: Use Ansible Enterprise SONiC collection version 1.1.0 or later 1.m.n versions (from the 1.x branch of this repo)
139 * Dell Enterprise SONiC images for release 4.0 and later 4.x.y releases before 4.4.0: Use Ansible Enterprise SONiC collection version 2.0.0 or later 2.m.n releases (from the "2.x" branch of this repo).
140 * Dell Enterprise SONiC images for release 4.4.0 and later 4.x.y releases: Use Ansible Enterprise SONiC collection version 3.0.0 or later 3.m.n releases (from the "main" branch of this repo).
141
142
143 > **NOTE**: Community SONiC versions that include the Management Framework container should work as well, however, this collection has not been tested nor validated
144 with community versions and is not supported.
145
146 ##### Setting Environment Variables
147
148 Option 1: Add the environment variable while running the playbook.
149
150
151 ANSIBLE_NETWORK_GROUP_MODULES=sonic ansible-playbook sample_playbook.yaml -i inventory.ini
152
153
154 Option 2: Add the environment variable in user profile.
155
156
157 ANSIBLE_NETWORK_GROUP_MODULES=sonic
158
159
160 Installation of Enterprise SONiC collection from Ansible Galaxy
161 ---------------------------------------------------------------
162
163 Install the latest version of the Enterprise SONiC collection from Ansible Galaxy.
164
165 ansible-galaxy collection install dellemc.enterprise_sonic
166
167 To install a specific version, specify a version range identifier. For example, to install the most recent version that is greater than or equal to 1.0.0 and less than 2.0.0.
168
169 ansible-galaxy collection install 'dellemc.enterprise_sonic:>=1.0.0,<2.0.0'
170
171
172 Sample playbooks
173 -----------------
174 **VLAN configuration using CLICONF**
175
176 ***sonic_network_cli.yaml***
177
178 ---
179
180 - name: SONiC Management Framework CLI configuration examples
181 hosts: sonic_switches
182 gather_facts: no
183 connection: network_cli
184 tasks:
185 - name: Add VLAN entry
186 dellemc.enterprise_sonic.sonic_config:
187 commands: ['interface Vlan 700','exit']
188 save: yes
189 register: config_op
190 - name: Test SONiC single command
191 dellemc.enterprise_sonic.sonic_command:
192 commands: 'show vlan'
193 register: cmd_op
194
195 **VLAN configuration using HTTPAPI**
196
197 ***sonic_httpapi.yaml***
198
199 ---
200
201 - name: SONiC Management Framework REST API examples
202 hosts: sonic_switches
203 gather_facts: no
204 connection: httpapi
205 tasks:
206 - name: Perform PUT operation to add a VLAN network instance
207 dellemc.enterprise_sonic.sonic_api:
208 url: data/openconfig-network-instance:network-instances/network-instance=Vlan100
209 method: "PUT"
210 body: {"openconfig-network-instance:network-instance": [{"name": "Vlan100","config": {"name": "Vlan100"}}]}
211 status_code: 204
212 - name: Perform GET operation to view VLAN network instance
213 dellemc.enterprise_sonic.sonic_api:
214 url: data/openconfig-network-instance:network-instances/network-instance=Vlan100
215 method: "GET"
216 status_code: 200
217 register: api_op
218
219 **Configuration using network resource modules**
220
221 ***sonic_resource_modules.yaml***
222
223 ---
224
225 - name: VLANs, Layer 2 and Layer 3 interfaces configuration using Enterprise SONiC resource modules
226 hosts: sonic_switches
227 gather_facts: no
228 connection: httpapi
229 tasks:
230 - name: Configure VLANs
231 dellemc.enterprise_sonic.sonic_vlans:
232 config:
233 - vlan_id: 701
234 - vlan_id: 702
235 - vlan_id: 703
236 - vlan_id: 704
237 state: merged
238 register: sonic_vlans_output
239 - name: Configure Layer 2 interfaces
240 dellemc.enterprise_sonic.sonic_l2_interfaces:
241 config:
242 - name: Eth1/2
243 access:
244 vlan: 701
245 trunk:
246 allowed_vlans:
247 - vlan: 702
248 - vlan: 703
249 state: merged
250 register: sonic_l2_interfaces_output
251 - name: Configure Layer 3 interfaces
252 dellemc.enterprise_sonic.sonic_l3_interfaces:
253 config:
254 - name: Eth1/3
255 ipv4:
256 - address: 8.1.1.1/16
257 ipv6:
258 - address: 3333::1/16
259 state: merged
260 register: sonic_l3_interfaces_output
261
262 ***host_vars/sonic_sw1.yaml***
263
264 hostname: sonic_sw1
265
266 # Common parameters for connection type httpapi or network_cli:
267 ansible_user: xxxx
268 ansible_password: xxxx
269 ansible_network_os: dellemc.enterprise_sonic.sonic
270
271 # Additional parameters for connection type httpapi:
272 ansible_httpapi_use_ssl: true
273 ansible_httpapi_validate_certs: false
274
275 ***inventory.ini***
276
277 [sonic_sw1]
278 sonic_sw1 ansible_host=100.104.28.119
279
280 [sonic_sw2]
281 sonic_sw2 ansible_host=100.104.28.120
282
283 [sonic_switches:children]
284 sonic_sw1
285 sonic_sw2
286
287 Support
288 -------
289
290 Support is provided for all of the collection modules for Ansible version 2.17 or higher.
291
292 To submit a support request for this collection, open a [GitHub issue](https://github.com/ansible-collections/dellemc.enterprise_sonic/issues) under the collection repository.
293
294 Releasing, Versioning and Deprecation
295 -------------------------------------
296
297 This collection follows [Semantic Versioning](https://semver.org/). More details on versioning can be found [in the Ansible docs](https://docs.ansible.com/ansible/latest/dev_guide/developing_collections.html#collection-versions).
298
299 We plan to regularly release new minor or bugfix versions once new features or bugfixes have been implemented.
300
301 Enterprise SONiC Ansible Modules deprecation cycle is aligned with [Ansible](https://docs.ansible.com/ansible/latest/dev_guide/module_lifecycle.html).
302
303 Source control branches on Github:
304 - Released code versions are located on "release" branches with names of the form "M.x", where "M" specifies the "major" release version for releases residing on the branch.
305 - Unreleased and pre-release code versions are located on sub-branches of the "main" branch. This is a development branch, and is not intended for use in production environments.
306
307 Code of Conduct
308 ---------------
309
310 This repository adheres to the [Ansible Community code of conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html)
311
312 Communication
313 -------------
314
315 * Join the Ansible forum:
316 * [Get Help](https://forum.ansible.com/c/help/6): get help or help others.
317 * [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
318 * [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
319
320 * The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
321
322 For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
323
324 License Information
325 -------------------
326
327 This collection is published under the [GNU General Public License](https://github.com/ansible-collections/dellemc.enterprise_sonic/blob/main/LICENSE).
328
329
330 © Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved.