dellemc.enterprise_sonic.sonic_system (2.4.0) — module

Configure system parameters

| "added in version" 1.0.0 of dellemc.enterprise_sonic"

Authors: Abirami N (@abirami-n)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install dellemc.enterprise_sonic:==2.4.0


Add to requirements.yml

  collections:
    - name: dellemc.enterprise_sonic
      version: 2.4.0

Description

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

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Using deleted
#
# 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

- name: Merge provided configuration with device configuration
  dellemc.enterprise_sonic.sonic_system:
    config:
      hostname: SONIC
      interface_naming: standard
      anycast_address:
        ipv6: true
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#!
#sonic(config)#do show running-configuration
#!
#ip anycast-mac-address aa:bb:cc:dd:ee:ff
#ip anycast-address enable


# Using deleted
#
# 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

- name: Delete all system related configs in device configuration
  dellemc.enterprise_sonic.sonic_system:
    config:
    state: deleted
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#!
#sonic(config)#do show running-configuration
#!


# Using merged
#
# 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
    state: merged
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After 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

# Using replaced
#
# 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

- name: Replace system configuration.
  sonic_system:
    config:
      hostname: sonic
      interface_naming: standard
    state: replaced
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#!
#SONIC(config)#do show running-configuration
#!
#interface-naming standard

# Using replaced
#
# Before state:
# -------------
#!
#sonic(config)#do show running-configuration
#!
#ip anycast-mac-address aa:bb:cc:dd:ee:ff
#interface-naming standard

- name: Replace system device configuration.
  sonic_system:
    config:
      hostname: sonic
      interface_naming: standard
      anycast_address:
        ipv6: true
        ipv4: true
    state: replaced
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# After state:
# ------------
#!
#SONIC(config)#do show running-configuration
#!
#ip anycast-address enable
#ipv6 anycast-address enable
#interface-naming standard

# Using overridden
#
# 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

- name: Override system configuration.
  sonic_system:
    config:
      hostname: sonic
      interface_naming: standard
      anycast_address:
        ipv4: true
        mac_address: bb:aa:cc:dd:ee:ff
    state: overridden

Inputs

    
state:
    choices:
    - merged
    - replaced
    - overridden
    - deleted
    default: merged
    description:
    - 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.
    type: str

config:
    description:
    - Specifies the system related configurations
    suboptions:
      anycast_address:
        description:
        - Specifies different types of anycast address that can be configured on the device
        suboptions:
          ipv4:
            description:
            - Enable or disable ipv4 anycast-address
            type: bool
          ipv6:
            description:
            - Enable or disable ipv6 anycast-address
            type: bool
          mac_address:
            description:
            - Specifies the mac anycast-address
            type: str
        type: dict
      hostname:
        description:
        - Specifies the hostname of the SONiC device
        type: str
      interface_naming:
        choices:
        - standard
        - native
        description:
        - Specifies the type of interface-naming in device
        type: str
    type: dict

Outputs

after:
  description: The resulting configuration model invocation.
  returned: when changed
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
  type: list
before:
  description: The configuration prior to the model invocation.
  returned: always
  sample: "The configuration returned will always be in the same format\n of the parameters\
    \ above.\n"
  type: list
commands:
  description: The set of commands pushed to the remote device.
  returned: always
  sample:
  - command 1
  - command 2
  - command 3
  type: list