--- - name: Ansible resource module example hosts: datacenter gather_facts: False connection: httpapi collections: - dellemc.enterprise_sonic tasks: - name: Delete all vlans configuration sonic_interfaces: config: state: deleted - name: Create vlans sonic_vlans: config: - vlan_id: 500 - vlan_id: 501 state: merged - name: Merge some vlans configuration sonic_interfaces: config: - name: Vlan500 mtu: 5000 description: "vlan500 description" - name: Vlan501 mtu: 6000 description: "vlan501 description" state: merged - name: Delete some vlans configuration sonic_interfaces: config: - name: Vlan500 - name: Vlan501 mtu: 6000 description: "vlan501 description" state: deleted - name: Merge some loopback configuration sonic_interfaces: config: - name: Loopback100 - name: Loopback101 state: merged - name: Delete some loopback configuration sonic_interfaces: config: - name: Loopback100 - name: Loopback102 state: deleted - name: Merge some ethernet configuration sonic_interfaces: config: - name: Ethernet20 description: ansible Ethernet20 mtu: 5666 enabled: false - name: Ethernet24 description: ansible Ethernet24 mtu: 6000 enabled: true - name: Ethernet28 description: ansible Ethernet28 mtu: 5222 enabled: true state: merged - name: Replace some ethernet configuration sonic_interfaces: config: - name: Ethernet20 description: Replaced ansible Ethernet20 mtu: 6666 enabled: false - name: Ethernet24 description: Replaced ansible Ethernet24 mtu: 6000 enabled: true state: replaced - name: Override ethernet configuration sonic_interfaces: config: - name: Ethernet20 description: Overridden ansible Ethernet20 mtu: 2020 enabled: true - name: Ethernet28 description: Overridden ansible Ethernet28 mtu: 2828 enabled: true - name: Ethernet32 description: ansible Ethernet32 mtu: 3232 enabled: false state: overridden - name: Delete some ethernet configuration sonic_interfaces: config: - name: Ethernet20 - name: Ethernet28 state: deleted