.. Document meta :orphan: .. |antsibull-internal-nbsp| unicode:: 0xA0 :trim: .. role:: ansible-attribute-support-label .. role:: ansible-attribute-support-property .. role:: ansible-attribute-support-full .. role:: ansible-attribute-support-partial .. role:: ansible-attribute-support-none .. role:: ansible-attribute-support-na .. role:: ansible-option-type .. role:: ansible-option-elements .. role:: ansible-option-required .. role:: ansible-option-versionadded .. role:: ansible-option-aliases .. role:: ansible-option-choices .. role:: ansible-option-choices-default-mark .. role:: ansible-option-default-bold .. role:: ansible-option-configuration .. role:: ansible-option-returned-bold .. role:: ansible-option-sample-bold .. Anchors .. _ansible_collections.amnesh.soodar.soodar_interfaces_module: .. Anchors: short name for ansible.builtin .. Anchors: aliases .. Title amnesh.soodar.soodar_interfaces module -- Manages interface attributes of Amnesh Soodar network devices +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. Collection note .. note:: This module is part of the `amnesh.soodar collection `_ (version 1.0.0). To install it, use: :code:`ansible-galaxy collection install https://soodar.ir/ansible/amnesh.soodar.tar.gz`. To use it in a playbook, specify: :code:`amnesh.soodar.soodar_interfaces`. .. version_added .. rst-class:: ansible-version-added New in amnesh.soodar 1.0 .. contents:: :local: :depth: 1 .. Deprecated Synopsis -------- .. Description - This module manages the interface attributes of Amnesh Soodar network devices. .. note:: This module has a corresponding :ref:`action plugin `. .. Aliases .. Requirements .. Options Parameters ---------- .. rst-class:: ansible-option-table .. list-table:: :width: 100% :widths: auto :header-rows: 1 * - Parameter - Comments * - .. raw:: html
.. _ansible_collections.amnesh.soodar.soodar_interfaces_module__parameter-config: .. rst-class:: ansible-option-title **config** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`list` / :ansible-option-elements:`elements=dictionary` .. raw:: html
- .. raw:: html
A dictionary of interface options .. raw:: html
* - .. raw:: html
.. _ansible_collections.amnesh.soodar.soodar_interfaces_module__parameter-config/description: .. rst-class:: ansible-option-title **description** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
Interface description. .. raw:: html
* - .. raw:: html
.. _ansible_collections.amnesh.soodar.soodar_interfaces_module__parameter-config/enabled: .. rst-class:: ansible-option-title **enabled** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`boolean` .. raw:: html
- .. raw:: html
Administrative state of the interface. Set the value to \ :literal:`true`\ to administratively enable the interface or \ :literal:`false`\ to disable it. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry:`false` - :ansible-option-choices-entry-default:`true` :ansible-option-choices-default-mark:`← (default)` .. raw:: html
* - .. raw:: html
.. _ansible_collections.amnesh.soodar.soodar_interfaces_module__parameter-config/mtu: .. rst-class:: ansible-option-title **mtu** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
MTU for a specific interface. Must be a number between 64 and 9600. Applicable for Ethernet interfaces only. .. raw:: html
* - .. raw:: html
.. _ansible_collections.amnesh.soodar.soodar_interfaces_module__parameter-config/name: .. rst-class:: ansible-option-title **name** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` / :ansible-option-required:`required` .. raw:: html
- .. raw:: html
Full name of interface, e.g. ge0, tunnel20. .. raw:: html
* - .. raw:: html
.. _ansible_collections.amnesh.soodar.soodar_interfaces_module__parameter-running_config: .. rst-class:: ansible-option-title **running_config** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
This option is used only with state \ :emphasis:`parsed`\ . The value of this option should be the output received from the Soodar device by executing the command \ :strong:`show running-config | section ^interface`\ . The state \ :emphasis:`parsed`\ reads the configuration from \ :literal:`running\_config`\ option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the \ :emphasis:`parsed`\ key within the result. .. raw:: html
* - .. raw:: html
.. _ansible_collections.amnesh.soodar.soodar_interfaces_module__parameter-state: .. rst-class:: ansible-option-title **state** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`string` .. raw:: html
- .. raw:: html
The state the configuration should be left in The states \ :emphasis:`rendered`\ , \ :emphasis:`gathered`\ and \ :emphasis:`parsed`\ does not perform any change on the device. The state \ :emphasis:`rendered`\ will transform the configuration in \ :literal:`config`\ option to platform specific CLI commands which will be returned in the \ :emphasis:`rendered`\ key within the result. For state \ :emphasis:`rendered`\ active connection to remote host is not required. The state \ :emphasis:`gathered`\ will fetch the running configuration from device and transform it into structured data in the format as per the resource module argspec and the value is returned in the \ :emphasis:`gathered`\ key within the result. The state \ :emphasis:`parsed`\ reads the configuration from \ :literal:`running\_config`\ option and transforms it into JSON format as per the resource module parameters and the value is returned in the \ :emphasis:`parsed`\ key within the result. The value of \ :literal:`running\_config`\ option should be the same format as the output of command \ :emphasis:`show running-config | include ip route|ipv6 route`\ executed on device. For state \ :emphasis:`parsed`\ active connection to remote host is not required. .. rst-class:: ansible-option-line :ansible-option-choices:`Choices:` - :ansible-option-choices-entry-default:`"merged"` :ansible-option-choices-default-mark:`← (default)` - :ansible-option-choices-entry:`"replaced"` - :ansible-option-choices-entry:`"overridden"` - :ansible-option-choices-entry:`"deleted"` - :ansible-option-choices-entry:`"rendered"` - :ansible-option-choices-entry:`"gathered"` - :ansible-option-choices-entry:`"parsed"` .. raw:: html
.. Attributes .. Notes Notes ----- .. note:: - Tested against Soodar Version 21.04 .. Seealso .. Examples Examples -------- .. code-block:: yaml+jinja # Using Deleted # Before state: # ------------- # # soodar# show running-config | section ^interface # interface ge1 # no ip address # interface ge2 # description Configured and Overridden by Ansible Network # no ip address # interface ge3 # description Configured and Replaced by Ansible Network # mtu 2500 # no ip address # shutdown - name: Delete attributes of given interfaces (Note: This won't delete the interface itself) soodar_interfaces: config: - name: ge2 - name: ge3 operation: deleted # After state: # ------------- # # soodar# show running-config | section ^interface # interface ge1 # no ip address # interface ge2 # no ip address # interface ge3 # no ip address # Using merged # Before state: # ------------- # # soodar#show running-config | section ^interface # interface ge1 # description Configured by Ansible # no ip address # interface ge2 # description This is test # no ip address # interface ge3 # no ip address - name: Merge provided configuration with device configuration soodar_interfaces: config: - name: ge2 description: 'Configured and Merged by Ansible Network' enabled: True - name: ge3 description: 'Configured and Merged by Ansible Network' mtu: 2800 enabled: False operation: merged # After state: # ------------ # # soodar#show running-config | section ^interface # interface ge1 # description Configured by Ansible # no ip address # interface ge2 # description Configured and Merged by Ansible Network # no ip address # no shutdown # interface ge3 # description Configured and Merged by Ansible Network # mtu 2800 # no ip address # shutdown # Using overridden # Before state: # ------------- # # soodar#show running-config | section ^interface# # interface ge1 # description Configured by Ansible # no ip address # interface ge2 # description This is test # no ip address # interface ge3 # description Configured by Ansible # mtu 2800 # no ip address # shutdown - name: Override device configuration of all interfaces with provided configuration soodar_interfaces: config: - name: ge2 description: 'Configured and Overridden by Ansible Network' mtu: 3000 - name: ge3 description: 'Configured and Overridden by Ansible Network' enabled: False mtu: 2000 operation: overridden # After state: # ------------- # # soodar#show running-config | section ^interface # interface ge1 # no ip address # interface ge2 # description Configured and Overridden by Ansible Network # no ip address # mtu 3000 # interface ge3 # description Configured and Overridden by Ansible Network # mtu 2000 # no ip address # shutdown # Using replaced # Before state: # ------------- # # soodar#show running-config | section ^interface # interface ge1 # no ip address # interface ge2 # description Configured by Ansible Network # no ip address # interface ge3 # mtu 2000 # no ip address # shutdown - name: Replaces device configuration of listed interfaces with provided configuration soodar_interfaces: config: - name: ge3 description: 'Configured and Replaced by Ansible Network' enabled: False mtu: 2500 operation: replaced # After state: # ------------- # # soodar#show running-config | section ^interface # interface ge1 # no ip address # interface ge2 # description Configured by Ansible Network # no ip address # interface ge3 # description Configured and Replaced by Ansible Network # mtu 2500 # no ip address # shutdown # Using Gathered # Before state: # ------------- # # soodar# sh running-config | section ^interface # interface ge1 # no shutdown # description this is interface1 # mtu 65 # interface ge2 # description this is interface2 # mtu 110 # shutdown - name: Gather listed interfaces with provided configurations amnesh.soodar.soodar_interfaces: config: state: gathered # Module Execution Result: # ------------------------ # # "gathered": [ # { # "description": "this is interface1", # "enabled": true, # "mtu": 65, # "name": "ge1", # }, # { # "description": "this is interface2", # "duplex": "auto", # "enabled": false, # "mtu": 110, # } # ] # After state: # ------------ # # soodar# sh running-config | section ^interface # interface ge1 # no shutdown # description this is interface1 # mtu 65 # interface ge2 # description this is interface2 # mtu 110 # shutdown # Using Rendered - name: Render the commands for provided configuration amnesh.soodar.soodar_interfaces: config: - name: ge1 description: Configured by Ansible-Network mtu: 110 enabled: true - name: ge2 description: Configured by Ansible-Network mtu: 2800 enabled: false state: rendered # Module Execution Result: # ------------------------ # # "rendered": [ # "interface ge1", # "description Configured by Ansible-Network", # "mtu 110", # "no shutdown", # "interface ge2", # "description Configured by Ansible-Network", # "mtu 2800", # "shutdown" # Using Parsed # File: parsed.cfg # ---------------- # # interface ge1 # description interfaces 0/1 # mtu 110 # no shutdown # interface ge2 # description interfaces 0/2 # mtu 2800 # shutdown - name: Parse the commands for provided configuration amnesh.soodar.soodar_interfaces: running_config: "{{ lookup('file', 'parsed.cfg') }}" state: parsed # Module Execution Result: # ------------------------ # # "parsed": [ # { # "description": "interfaces 0/1", # "enabled": true, # "mtu": 110, # "name": "ge1" # }, # { # "description": "interfaces 0/2", # "enabled": true, # "mtu": 2800, # "name": "ge2", # } # ] .. Facts .. Return values Return Values ------------- Common return values are documented :ref:`here `, the following are the fields unique to this module: .. rst-class:: ansible-option-table .. list-table:: :width: 100% :widths: auto :header-rows: 1 * - Key - Description * - .. raw:: html
.. _ansible_collections.amnesh.soodar.soodar_interfaces_module__return-after: .. rst-class:: ansible-option-title **after** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`list` / :ansible-option-elements:`elements=string` .. raw:: html
- .. raw:: html
The configuration as structured data after module completion. .. rst-class:: ansible-option-line :ansible-option-returned-bold:`Returned:` when changed .. rst-class:: ansible-option-line .. rst-class:: ansible-option-sample :ansible-option-sample-bold:`Sample:` :ansible-rv-sample-value:`["The configuration returned will always be in the same format of the parameters above."]` .. raw:: html
* - .. raw:: html
.. _ansible_collections.amnesh.soodar.soodar_interfaces_module__return-before: .. rst-class:: ansible-option-title **before** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`list` / :ansible-option-elements:`elements=string` .. raw:: html
- .. raw:: html
The configuration as structured data prior to module invocation. .. rst-class:: ansible-option-line :ansible-option-returned-bold:`Returned:` always .. rst-class:: ansible-option-line .. rst-class:: ansible-option-sample :ansible-option-sample-bold:`Sample:` :ansible-rv-sample-value:`["The configuration returned will always be in the same format of the parameters above."]` .. raw:: html
* - .. raw:: html
.. _ansible_collections.amnesh.soodar.soodar_interfaces_module__return-commands: .. rst-class:: ansible-option-title **commands** .. raw:: html .. rst-class:: ansible-option-type-line :ansible-option-type:`list` / :ansible-option-elements:`elements=string` .. raw:: html
- .. raw:: html
The set of commands pushed to the remote device .. rst-class:: ansible-option-line :ansible-option-returned-bold:`Returned:` always .. rst-class:: ansible-option-line .. rst-class:: ansible-option-sample :ansible-option-sample-bold:`Sample:` :ansible-rv-sample-value:`["interface ge0", "description This is test", "mtu 1500"]` .. raw:: html
.. Status (Presently only deprecated) .. Authors Authors ~~~~~~~ - Mahdi Varasteh (@m-varasteh) .. Extra links Collection links ~~~~~~~~~~~~~~~~ .. raw:: html .. Parsing errors