dellemc.enterprise_sonic.sonic_system module – Configure system parameters

Note

This module is part of the dellemc.enterprise_sonic collection (version 3.2.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install dellemc.enterprise_sonic.

To use it in a playbook, specify: dellemc.enterprise_sonic.sonic_system.

New in dellemc.enterprise_sonic 1.0.0

Synopsis

  • This module is used for configuration management of global system parameters on devices running Enterprise SONiC.

Parameters

Parameter

Comments

config

dictionary

Specifies the system related configurations

adjust_txrx_clock_freq

boolean

added in dellemc.enterprise_sonic 3.1.0

Adjust TX/RX clock frequency to platform specific value.

Operational default value is false.

Choices:

  • false

  • true

anycast_address

dictionary

Specifies different types of anycast address that can be configured on the device

ipv4

boolean

Enable or disable ipv4 anycast-address

Choices:

  • false

  • true

ipv6

boolean

Enable or disable ipv6 anycast-address

Choices:

  • false

  • true

mac_address

string

Specifies the mac anycast-address

audit_rules

string

added in dellemc.enterprise_sonic 2.5.0

Specifies audit rule profile type.

Can be used on SONiC release versions 4.4.0 and above.

Choices:

  • "BASIC"

  • "DETAIL"

  • "CUSTOM"

  • "NONE"

auto_breakout

string

added in dellemc.enterprise_sonic 2.5.0

Specifies auto-breakout status in the device

Choices:

  • "ENABLE"

  • "DISABLE"

concurrent_session_limit

integer

added in dellemc.enterprise_sonic 3.1.0

Specifies limit on number of concurrent sessions

Range 1-12

hostname

string

Specifies the hostname of the SONiC device

interface_naming

string

Specifies the type of interface-naming in device

Choices:

  • "standard"

  • "standard_extended"

  • "native"

load_share_hash_algo

string

added in dellemc.enterprise_sonic 2.5.0

Specifies different types of ECMP Load share hash algorithm

Choices:

  • "CRC"

  • "XOR"

  • "CRC_32LO"

  • "CRC_32HI"

  • "CRC_CCITT"

  • "CRC_XOR"

  • "JENKINS_HASH_LO"

  • "JENKINS_HASH_HI"

password_complexity

dictionary

The set of login password attribute configurations

min_length

integer

Minimum number of required alphanumeric characters

The range is from 6 to 32

Default is 8

min_lower_case

integer

Minimum number of lowercase characters required

The range is from 0 to 31

min_numerals

integer

Minimum number of numeric characters required

The range is from 0 to 31

min_spl_char

integer

Minimum number of special characters required

The range is from 0 to 31

min_upper_case

integer

Minimum number of uppercase characters required

The range is from 0 to 31

switching_mode

string

added in dellemc.enterprise_sonic 3.1.0

Specifies switching mode in the device.

Operational default value is STORE_AND_FORWARD.

Choices:

  • "CUT_THROUGH"

  • "STORE_AND_FORWARD"

state

string

Specifies the operation to be performed on the system parameters configured on the device.

In case of merged, the input configuration will be merged with the existing system configuration on the device.

In case of deleted the existing system configuration will be removed from the device.

Choices:

  • "merged" ← (default)

  • "replaced"

  • "overridden"

  • "deleted"

Notes

Note

  • Tested against Enterprise SONiC Distribution by Dell Technologies.

  • Supports check_mode.

Examples

# Using "deleted" state
#
# Before state:
# -------------
# !
# SONIC(config)#do show running-configuration
# !
# ip anycast-mac-address aa:bb:cc:dd:ee:ff
# ip anycast-address enable
# ipv6 anycast-address enable
# interface-naming standard
# ip load-share hash algorithm JENKINS_HASH_HI
# login concurrent-session limit 4
# system adjust-txrx-clock-freq
# login password-attribute character-restriction lower 2

- name: Delete System configuration
  dellemc.enterprise_sonic.sonic_system:
    config:
      hostname: SONIC
      interface_naming: standard
      anycast_address:
        ipv6: true
      load_share_hash_algo: JENKINS_HASH_HI
      concurrent_session_limit: 4
      adjust_txrx_clock_freq: true
      password_complexity:
        min_lower_case: 2
    state: deleted

# After state:
# ------------
# !
# sonic(config)#do show running-configuration
# !
# ip anycast-mac-address aa:bb:cc:dd:ee:ff
# ip anycast-address enable


# Using "deleted" state
#
# Before state:
# -------------
# !
# SONIC(config)#do show running-configuration
# !
# ip anycast-mac-address aa:bb:cc:dd:ee:ff
# ip anycast-address enable
# ipv6 anycast-address enable
# interface-naming standard
# ip load-share hash algorithm JENKINS_HASH_HI
# login concurrent-session limit 4

- name: Delete all system related configs in device configuration
  dellemc.enterprise_sonic.sonic_system:
    config:
    state: deleted

# After state:
# ------------
# !
# sonic(config)#do show running-configuration
# !


# Using "merged" state
#
# Before state:
# -------------
# !
# sonic(config)#do show running-configuration
# !

- name: Merge provided configuration with device configuration
  dellemc.enterprise_sonic.sonic_system:
    config:
      hostname: SONIC
      interface_naming: standard
      anycast_address:
        ipv6: true
        ipv4: true
        mac_address: aa:bb:cc:dd:ee:ff
      load_share_hash_algo: JENKINS_HASH_HI
      concurrent_session_limit: 4
      adjust_txrx_clock_freq: true
      password_complexity:
        min_upper_case: 2
        min_spl_char: 2
    state: merged

# After state:
# ------------
# !
# SONIC(config)#do show running-configuration
# !
# hostname SONIC
# ip anycast-mac-address aa:bb:cc:dd:ee:ff
# ip anycast-address enable
# ipv6 anycast-address enable
# interface-naming standard
# ip load-share hash algorithm JENKINS_HASH_HI
# login concurrent-session limit 4
# system adjust-txrx-clock-freq
# login password-attribute character-restriction upper 2
# login password-attribute character-restriction special-char 2

# Using "replaced" state
#
# Before state:
# -------------
# !
# sonic(config)#do show running-configuration
# !
# ip anycast-mac-address aa:bb:cc:dd:ee:ff
# ip anycast-address enable
# ipv6 anycast-address enable
# interface-naming standard
# login concurrent-session limit 4
# login password-attribute character-restriction upper 2
# login password-attribute character-restriction special-char 2

- name: Replace system configuration.
  sonic_system:
    config:
      hostname: SONIC
      anycast_address:
        ipv6: true
      concurrent_session_limit: 5
      password_complexity:
        min_lower_case: 2
    state: replaced

# After state:
# ------------
# !
# SONIC(config)#do show running-configuration
# !
# hostname SONIC
# ipv6 anycast-address enable
# login concurrent-session limit 5
# login password-attribute character-restriction lower 2

# Using "replaced" state
#
# Before state:
# -------------
# !
# sonic(config)#do show running-configuration
# !
# ip anycast-mac-address aa:bb:cc:dd:ee:ff
# interface-naming standard
# login concurrent-session limit 5
# login password-attribute character-restriction lower 2

- name: Replace system device configuration.
  sonic_system:
    config:
      hostname: sonic
      interface_naming: standard
      anycast_address:
        ipv6: true
        ipv4: true
      load_share_hash_algo: JENKINS_HASH_HI
      password_complexity:
        min_numerals: 2
    state: replaced

# After state:
# ------------
# !
# sonic(config)#do show running-configuration
# !
# ip anycast-address enable
# ipv6 anycast-address enable
# interface-naming standard
# ip load-share hash algorithm JENKINS_HASH_HI
# login password-attribute character-restriction numeric 2

# Using "overridden" state
#
# Before state:
# -------------
# !
# sonic(config)#do show running-configuration
# !
# ipv6 anycast-address enable
# ip load-share hash algorithm JENKINS_HASH_HI
# login concurrent-session limit 5
# login password-attribute character-restriction numeric 2

- name: Override system configuration.
  sonic_system:
    config:
      hostname: SONIC
      interface_naming: standard
      anycast_address:
        ipv4: true
        mac_address: bb:aa:cc:dd:ee:ff
      load_share_hash_algo: CRC_XOR
      concurrent_session_limit: 4
      password_complexity:
        min_upper_case: 1
    state: overridden

# After state:
# ------------
# !
# SONIC(config)#do show running-configuration
# !
# hostname SONIC
# ip anycast-mac-address bb:aa:cc:dd:ee:ff
# ip anycast-address enable
# interface-naming standard
# ip load-share hash algorithm CRC_XOR
# login concurrent-session limit 4
# login password-attribute character-restriction upper 1

# Using "merged" state
#
# Before state:
# -------------
# !
# sonic(config)#do show running-configuration
# !

- name: Merge provided configuration with device configuration
  dellemc.enterprise_sonic.sonic_system:
    config:
      hostname: SONIC
      interface_naming: standard
      auto_breakout: ENABLE
      load_share_hash_algo: JENKINS_HASH_HI
      audit_rules: BASIC
    state: merged

# After state:
# ------------
# !
# SONIC(config)#do show running-configuration
# !
# hostname SONIC
# interface-naming standard
# auto-breakout
# ip load-share hash algorithm JENKINS_HASH_HI
# auditd-system rules basic

# Using "deleted" state
#
# Before state:
# -------------
# !
# SONIC(config)#do show running-configuration
# !
# hostname SONIC
# interface-naming standard
# auto-breakout
# ip load-share hash algorithm JENKINS_HASH_HI
# auditd-system rules basic

- name: Delete auto-breakout configuration on the device
  dellemc.enterprise_sonic.sonic_system:
    config:
      hostname: SONIC
      auto_breakout: ENABLE
      load_share_hash_algo: JENKINS_HASH_HI
      audit_rules: BASIC
    state: deleted

# After state:
# ------------
# !
# sonic(config)#do show running-configuration
# !
# interface-naming standard

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

after

list / elements=string

The resulting configuration module invocation.

Returned: when changed

Sample: ["The configuration returned will always be in the same format as the parameters above.\n"]

before

list / elements=string

The configuration prior to the module invocation.

Returned: always

Sample: ["The configuration returned will always be in the same format as the parameters above.\n"]

commands

list / elements=string

The set of commands pushed to the remote device.

Returned: always

Sample: ["command 1", "command 2", "command 3"]

Authors

  • Abirami N (@abirami-n)