Closed fzakfeld closed 7 months ago
The sequencing requirement described here is due to the underlying SONiC device restrictions.
There is no obvious, safe way to automatically prevent the error in an Ansible resource module implementation. (We feel that is safest to avoid automatically inferring and applying configuration or changing the order of invocation of plays without intermediate user involvement.)
As mentioned in the previous post on this issue: The only safe way of handling the situation described here it to order the tasks to perform the configuration actions in the required order:
1) Remove port channel configuration an any interfaces that need to be configured as L2 interfaces before configuring them as L2 interfaces. 2) Remove any L2 configuration on interfaces before attempting to make them members of a port channel.
If the "batched" configuration (and de-configuration) actions as shown above are desired, then a workable implementation would be something like:
- remove lag configuration for interfaces to be configured as L2 interfaces
- Apply any desired new L2 configuration
- Remove any current L2 configuration for interfaces to be configured as lag interfaces
- Apply lag configuration for any desired new lag interfaces.
Please see the posted responses above and let us know if there are any remaining questions or specific requests for new functionality to be added.
How can the team help?
We need to change some interfaces from being a LAG member to being a standalone L2 port, and vice versa. Problem is that the LAG can not be configured at physical interface level, but rather the interfaces need to be configured as a 'member' on the LAG interface using sonic_lag_interfaces.
Since configuring L2 and LAG interfaces are different tasks, one is executed at first. If the L2 interfaces are configured first, then there might still be a port-channel configured on a port making the config task fail.
Is there any recommended way of handling this?
Details: ?
Our task looks like this:
switch_ports | scaleup_sonic_lacp_interfaces
will return a list of LAG interfaces, in this case including one with Ethernet124 as the member.switch_ports | scaleup_sonic_l2_interfaces
will return a list of all L2 interfaces, without Ethernet124 (prior configured as L2 interface)Task runs: