cisco.nxos.nxos_fc_interfaces 模块 – Fc 接口资源模块
注意
此模块是 cisco.nxos 集合(版本 9.2.1)的一部分。
如果您正在使用 ansible
包,您可能已经安装了这个集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install cisco.nxos
。
要在 playbook 中使用它,请指定:cisco.nxos.nxos_fc_interfaces
。
cisco.nxos 5.2.0 中新增
概要
此模块管理 NX-OS fc 接口的接口属性。
参数
参数 |
注释 |
---|---|
接口选项的字典 |
|
fc 接口上的分析类型 选择
|
|
接口描述。 |
|
接口的管理状态。将值设置为 选择
|
|
fc 接口的端口模式 选择
|
|
接口的全名,例如 fc1/1、fc18/48 |
|
接口链路速度。 选择
|
|
fc 接口的链路模式 选择
|
|
此选项仅与状态 *parsed* 一起使用。 此选项的值应是通过执行命令 show running-config interface 从 NX-OS 设备接收的输出 状态 *parsed* 从 |
|
模块完成后配置的状态 选择
|
备注
注意
在 Cisco MDS 交换机上针对 NXOS 9.3(2) 进行了测试
示例
# 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
返回值
常见的返回值记录在 此处,以下是此模块独有的字段
键 |
描述 |
---|---|
模块执行后的结果配置。 返回: 当 changed 示例: |
|
模块执行之前的配置。 返回: 当 state 为 示例: |
|
推送到远程设备的命令集。 返回: 当 state 为 示例: |
|
从远程设备收集的关于网络资源的事实,作为结构化数据。 返回: 当 state 为 示例: |
|
根据模块 argspec,将 running_config 选项中提供的设备原生配置解析为结构化数据。 返回:当 state 为 示例: |
|
任务中提供的配置以设备原生格式(离线)渲染。 返回:当 state 为 示例: |