Spec-Zone.ru › Ansible

Модуль cisco.nxos.nxos_fc_interfaces – Модуль ресурса Fc Interfaces

Примечание

Этот модуль является частью коллекции cisco.nxos (версия 8.1.0).

Возможно, эта коллекция уже установлена, если вы используете пакет ansible. Она не включена в ansible-core. Чтобы проверить установку, выполните ansible-galaxy collection list.

Для установки используйте: ansible-galaxy collection install cisco.nxos.

Для использования в книге задач укажите: cisco.nxos.nxos_fc_interfaces.

Новое в cisco.nxos 5.2.0

  • Описание
  • Параметры
  • Примечания
  • Примеры
  • Возвращаемые значения

Описание

  • Этот модуль управляет атрибутами интерфейсов NX-OS fc интерфейсов.

Параметры

Параметр

Комментарии

config

список / элементы=словарь

Словарь параметров интерфейса

analytics

строка

Тип аналитики на fc интерфейсе

Варианты:

  • "fc-scsi"
  • "fc-nvme"
  • "fc-all"

description

строка

Описание интерфейса.

enabled

логическое

Административное состояние интерфейса. Установите значение в true для административного включения интерфейса или true для его отключения

Варианты:

  • false
  • true

mode

строка

Режим порта fc интерфейса

Варианты:

  • "auto"
  • "E"
  • "F"
  • "Fx"
  • "NP"
  • "SD"

name

строка / обязательно

Полное имя интерфейса, например fc1/1, fc18/48

speed

строка

Скорость соединения интерфейса.

Варианты:

  • "auto"
  • "1000"
  • "2000"
  • "4000"
  • "8000"
  • "10000"
  • "16000"
  • "32000"
  • "64000"
  • "auto max 2000"
  • "auto max 4000"
  • "auto max 8000"
  • "auto max 16000"
  • "auto max 32000"
  • "auto max 64000"

trunk_mode

строка

Режим trunk fc интерфейса

Варианты:

  • "auto"
  • "on"
  • "off"

running_config

строка

Этот параметр используется только со значением parsed.

Значение этого параметра должно быть результатом выполнения команды show running-config interface на устройстве NX-OS.

Значение parsed считывает конфигурацию из параметра running_config и преобразует ее в структурированные данные Ansible в соответствии с argspec модуля ресурса, а затем возвращает значение в ключе parsed в результате.

state

строка

Состояние конфигурации после завершения модуля

Варианты:

  • "merged" ← (по умолчанию)
  • "replaced"
  • "overridden"
  • "deleted"
  • "gathered"
  • "rendered"
  • "parsed"

Примечания

Примечание

  • Проверено на NXOS 9.3(2) на коммутаторах Cisco MDS

Примеры

# Using merged

# Before state:
# -------------
#
# switch# show running-config interface all
# interface fc18/10
#     analytics type fc-nvme
#     switchport speed auto max 16000
#     switchport mode auto
#     switchport description $
#     switchport trunk mode on
#     shutdown

- name: Merge provided configuration with device configuration
  cisco.nxos.nxos_fc_interfaces:
    config:
      - name: fc18/10
        analytics: fc-scsi
    state: merged

# Task Output
# -----------
#
# before:
# - name: fc18/10
#   speed: auto max 16000
#   mode: auto
#   trunk_mode: on
#   enabled: true
#   description: $
#   analytics: fc-nvme
# commands:
# - interface fc18/10
# - analytics type fc-scsi
# after:
# - name: fc18/10
#   speed: auto max 16000
#   mode: auto
#   trunk_mode: on
#   enabled: true
#   description: $
#   analytics: fc-all

# After state:
# ------------
#
# switch# show running-config interface all
# interface fc18/10
#     analytics type fc-scsi
#     analytics type fc-nvme
#     switchport speed auto max 16000
#     switchport mode auto
#     switchport description $
#     switchport trunk mode on
#     shutdown

# Using replaced

# Before state:
# -------------
#
# switch# show running-config interface all
# interface fc18/12
#     analytics type fc-scsi
#     analytics type fc-nvme
#     switchport speed auto max 64000
#     switchport mode auto
#     switchport description 1
#     switchport trunk mode on
#     no shutdown

- name: Replaces device configuration of listed interfaces with provided configuration
  cisco.nxos.nxos_fc_interfaces:
    config:
      - name: fc18/12
        speed: auto max 64000
        mode: auto
        trunk_mode: "on"
        enabled: true
        description: 1
        analytics: fc-scsi
    state: replaced

# Task Output
# -----------
#
# before:
# - name: fc18/12
#   speed: auto max 64000
#   mode: auto
#   trunk_mode: on
#   enabled: true
#   description: 1
#   analytics: fc-all
# commands:
# - interface fc18/12
# - no analytics type fc-all
# - analytics type fc-scsi
# after:
# - name: fc18/12
#   speed: auto max 64000
#   mode: auto
#   trunk_mode: on
#   enabled: true
#   description: 1
#   analytics: fc-scsi

# After state:
# ------------
#
# switch# show running-config interface all
# interface fc18/12
#     analytics type fc-scsi
#     switchport speed auto max 64000
#     switchport mode auto
#     switchport description 1
#     switchport trunk mode on
#     no shutdown


# Using deleted

# Before state:
# -------------
#
# switch# show running-config interface all
# interface fc1/2
#     switchport speed 1000
#     switchport mode E
#     no switchport description
#     switchport trunk mode off
#     no shutdown

- name: Delete or return interface parameters to default settings
  cisco.nxos.nxos_fc_interfaces:
    config:
      - name: fc1/2
    state: deleted

# Task Output
# -----------
#
# before:
# - name: fc1/2
#   speed: 1000
#   mode: E
#   trunk_mode: off
#   enabled: true
# commands:
# - interface fc1/2
# - no switchport speed 1000
# - no switchport mode E
# - switchport trunk mode on
# - shutdown
# after:
# - name: fc1/2
#   speed: auto
#   mode: auto
#   trunk_mode: on
#   enabled: true

# After state:
# ------------
#
# switch# show running-config interface all
# interface fc1/2
#     switchport speed auto
#     switchport mode auto
#     no switchport description
#     switchport trunk mode on
#     shutdown

# Using overridden

# Before state:
# -------------
#
# switch# show running-config interface all
# interface fc18/12
#     analytics type fc-scsi
#     analytics type fc-nvme
#     switchport speed auto max 64000
#     switchport mode auto
#     switchport description 1
#     switchport trunk mode on
#     no shutdown
# interface fc18/13
#     analytics type fc-scsi
#     analytics type fc-nvme
#     switchport speed auto max 64000
#     switchport mode auto
#     switchport description 1
#     switchport trunk mode on
#     no shutdown

- name: Replaces device configuration of listed interfaces with provided configuration
  cisco.nxos.nxos_fc_interfaces:
    config:
      - name: fc18/12
        speed: auto max 64000
        mode: auto
        trunk_mode: "on"
        enabled: true
        description: 1
        analytics: fc-scsi
    state: overridden

# Task Output
# -----------
#
# before:
# - name: fc18/12
#   speed: auto max 64000
#   mode: auto
#   trunk_mode: on
#   enabled: true
#   description: 1
#   analytics: fc-all
# - name: fc18/13
#   speed: auto max 64000
#   mode: auto
#   trunk_mode: on
#   enabled: true
#   description: 1
#   analytics: fc-all
# commands:
# - interface fc18/12
#   no analytics type fc-all
#   analytics type fc-scsi
# - interface fc18/13
#   no switchport description
#   no switchport speed auto max 64000
#   no switchport mode auto
#   switchport trunk mode on
#   shutdown
# after:
# - name: fc18/12
#   speed: auto max 64000
#   mode: auto
#   trunk_mode: on
#   enabled: true
#   description: 1
#   analytics: fc-scsi
# - name: fc18/13
#   speed: auto max 64000
#   mode: auto
#   trunk_mode: on
#   enabled: true

# After state:
# ------------
#
# switch# show running-config interface all
# interface fc18/12
#     analytics type fc-scsi
#     switchport speed auto max 64000
#     switchport mode auto
#     switchport description 1
#     switchport trunk mode on
#     no shutdown
# interface fc18/13
#     switchport mode auto
#     switchport trunk mode on
#     shutdown

# Using rendered

- name: Use rendered state to convert task input to device specific commands
  cisco.nxos.nxos_fc_interfaces:
    config:
      - name: fc1/1
        speed: auto
        mode: auto
        trunk_mode: "on"
        enabled: true
        description: This is a sample line
      - name: fc1/2
        speed: 1000
        mode: E
        trunk_mode: "off"
        enabled: true
        state: rendered

# Task Output
# -----------
#
# rendered:
# interface fc1/1
#     switchport speed auto
#     switchport mode auto
#     switchport description This is a sample line
#     switchport trunk mode on
#     no shutdown
#
# interface fc1/2
#     switchport speed 1000
#     switchport mode E
#     no switchport description
#     switchport trunk mode off
#     no shutdown

# Using parsed

# parsed.cfg
# ------------
#
# interface fc1/1
#     switchport speed auto
#     switchport mode auto
#     switchport description This is a sample line
#     switchport trunk mode on
#     no shutdown
#
# interface fc1/2
#     switchport speed 1000
#     switchport mode E
#     no switchport description
#     switchport trunk mode off
#     no shutdown

- name: Use parsed state to convert externally supplied config to structured format
  cisco.nxos.nxos_fc_interfaces:
    running_config: "{{ lookup('file', 'parsed.cfg') }}"
    state: parsed

# Task output
# -----------
#
#  parsed:
# - name: fc1/1
#   speed: auto
#   mode: auto
#   trunk_mode: on
#   enabled: true
#   description: This is a sample line
# - name: fc1/2
#   speed: 1000
#   mode: E
#   trunk_mode: off
#   enabled: true

# Using gathered

# Before state:
# -------------
#
# switch# show running-config | section interface
# interface fc1/1
#     switchport speed auto
#     switchport mode auto
#     switchport description This is a sample line
#     switchport trunk mode on
#     no shutdown
#
# interface fc1/2
#     switchport speed 1000
#     switchport mode E
#     no switchport description
#     switchport trunk mode off
#     no shutdown
#
- name: Gather interfaces facts from the device using nxos_fc_interfaces
  cisco.nxos.nxos_fc_interfaces:
    state: gathered
#
# Task output
# -----------
#
# - name: fc1/1
#   speed: auto
#   mode: auto
#   trunk_mode: on
#   enabled: true
#   description: This is a sample line
# - name: fc1/2
#   speed: 1000
#   mode: E
#   trunk_mode: off
#   enabled: true
END_OF_DOCUMENT_MARKER

Значения возврата

Общие значения возврата документированы здесь, следующие являются полями, уникальными для данного модуля:

Ключ

Описание

после

словарь

Результирующая конфигурация после выполнения модуля.

Возвращается: при изменении

Пример: "This output will always be in the same format as the module argspec.\n"

перед

словарь

Конфигурация до выполнения модуля.

Возвращается: когда состояние равно merged, replaced, overridden, deleted или purged

Пример: "This output will always be in the same format as the module argspec.\n"

команды

список / элементы=строка

Набор команд, отправленных на удалённое устройство.

Возвращается: когда состояние равно merged, replaced, overridden, deleted или purged

Пример: ["interface fc1/1", "description sample description", "shutdown"]

собрано

список / элементы=строка

Факты о сетевом ресурсе, собранные с удалённого устройства в виде структурированных данных.

Возвращается: когда состояние равно gathered

Пример: ["This output will always be in the same format as the module argspec.\n"]

обработано

список / элементы=строка

Родная конфигурация устройства, предоставленная в параметре running_config, обработана в структурированные данные согласно спецификации аргумента модуля.

Возвращается: когда состояние равно parsed

Пример: ["This output will always be in the same format as the module argspec.\n"]

отрендерено

список / элементы=строка

Предоставленная конфигурация в задаче, отрендеренная в формате устройства (оффлайн).

Возвращается: когда состояние равно rendered

Пример: ["interface fc1/1", "description sample description", "shutdown"]

Авторы

  • Сухас Бхарадвадж (@srbharadwaj)

Ссылки на сборку

  • Отслеживание проблем
  • Репозиторий (источники)

© 2012–2018 Michael DeHaan
© 2018–2024 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/cisco/nxos/nxos_fc_interfaces_module.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API