dellemc.enterprise_sonic.sonic_tacacs_server 模块 – 管理 TACACS 服务器及其参数
注意
此模块是 dellemc.enterprise_sonic 集合(版本 2.5.1)的一部分。
如果您正在使用 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install dellemc.enterprise_sonic
。
要在剧本中使用它,请指定:dellemc.enterprise_sonic.sonic_tacacs_server
。
dellemc.enterprise_sonic 1.1.0 中的新增功能
概要
此模块提供在运行 Enterprise SONiC 的设备上对 tacacs 服务器参数的配置管理。
注意
此模块有一个相应的 action 插件。
参数
参数 |
注释 |
---|---|
指定 tacacs 服务器相关配置。 |
|
指定 tacacs 服务器的身份验证类型。 选项
|
|
指定 tacacs 服务器的密钥。 |
|
指定 tacacs 服务器的服务器列表。 |
|
指定 tacacs 服务器列表的主机详细信息。 |
|
指定 tacacs 服务器主机的身份验证类型。 选项
|
|
指定 tacacs 服务器主机的密钥。 |
|
指定 tacacs 服务器主机的名称。 |
|
指定 tacacs 服务器主机的端口。 默认值: |
|
指定 tacacs 服务器主机的优先级。 默认值: |
|
指定 tacacs 服务器主机的超时时间。 默认值: |
|
指定 tacacs 服务器主机的 vrf。 默认值: |
|
指定 tacacs 服务器的源接口。 |
|
指定 tacacs 服务器的超时时间。 默认值: |
|
指定要在设备上配置的 tacacs 服务器上执行的操作。 对于 merged,输入模式配置将与设备上现有的 tacacs 服务器配置合并。 对于 deleted,将从设备中删除现有的 tacacs 服务器模式配置。 对于 replaced,现有的 tacacs 服务器配置将被提供的配置替换。 对于 overridden,现有的 tacacs 服务器配置将被提供的配置覆盖。 选项
|
注释
注意
已针对 Dell Technologies 的 Enterprise SONiC Distribution 进行测试。
支持
check_mode
。
示例
# Using deleted
#
# Before state:
# -------------
#
# do show tacacs-server
#---------------------------------------------------------
#TACACS Global Configuration
#---------------------------------------------------------
#source-interface : Ethernet12
#timeout : 10
#auth-type : login
#key : login
#------------------------------------------------------------------------------------------------
#HOST AUTH-TYPE KEY PORT PRIORITY TIMEOUT VRF
#------------------------------------------------------------------------------------------------
#1.2.3.4 pap ***** 50 2 10 mgmt
#localhost pap 49 1 5 default
#
- name: Merge tacacs configurations
dellemc.enterprise_sonic.sonic_tacacs_server:
config:
auth_type: login
key: login
source_interface: Ethernet 12
timeout: 10
servers:
host:
- name: 1.2.3.4
state: deleted
# After state:
# ------------
#
#do show tacacs-server
#---------------------------------------------------------
#TACACS Global Configuration
#---------------------------------------------------------
#timeout : 5
#auth-type : pap
#------------------------------------------------------------------------------------------------
#HOST AUTH-TYPE KEY PORT PRIORITY TIMEOUT VRF
#------------------------------------------------------------------------------------------------
#localhost pap 49 1 5 default
# Using deleted
#
# Before state:
# -------------
#
# do show tacacs-server
#---------------------------------------------------------
#TACACS Global Configuration
#---------------------------------------------------------
#source-interface : Ethernet12
#timeout : 10
#auth-type : login
#key : login
#------------------------------------------------------------------------------------------------
#HOST AUTH-TYPE KEY PORT PRIORITY TIMEOUT VRF
#------------------------------------------------------------------------------------------------
#1.2.3.4 pap ***** 50 2 10 mgmt
#localhost pap 49 1 5 default
#
- name: Merge tacacs configurations
dellemc.enterprise_sonic.sonic_tacacs_server:
config:
state: deleted
# After state:
# ------------
#
#do show tacacs-server
#---------------------------------------------------------
#TACACS Global Configuration
#---------------------------------------------------------
#timeout : 5
#auth-type : pap
# Using merged
#
# Before state:
# -------------
#
#sonic(config)# do show tacacs-server
#---------------------------------------------------------
#TACACS Global Configuration
#---------------------------------------------------------
#
- name: Merge tacacs configurations
dellemc.enterprise_sonic.sonic_tacacs_server:
config:
auth_type: pap
key: pap
source_interface: Ethernet 12
timeout: 10
servers:
host:
- name: 1.2.3.4
auth_type: pap
key: 1234
state: merged
# After state:
# ------------
#
#sonic(config)# do show tacacs-server
#---------------------------------------------------------
#TACACS Global Configuration
#---------------------------------------------------------
#source-interface : Ethernet12
#timeout : 10
#auth-type : pap
#key : pap
#------------------------------------------------------------------------------------------------
#HOST AUTH-TYPE KEY PORT PRIORITY TIMEOUT VRF
#------------------------------------------------------------------------------------------------
#1.2.3.4 pap 1234 49 1 5 default
#
# Using replaced
#
# Before state:
# -------------
#
#sonic(config)# do show tacacs-server
#---------------------------------------------------------
#TACACS Global Configuration
#---------------------------------------------------------
#source-interface : Ethernet12
#timeout : 10
#auth-type : pap
#key configured : Yes
#--------------------------------------------------------------------------------------
#HOST AUTH-TYPE KEY-CONFIG PORT PRIORITY TIMEOUT VRF
#--------------------------------------------------------------------------------------
#1.2.3.4 pap No 49 1 5 default
#
- name: Replace tacacs configurations
sonic_tacacs_server:
config:
auth_type: pap
key: pap
source_interface: Ethernet12
timeout: 10
servers:
- host:
name: 1.2.3.4
auth_type: mschap
key: 1234
state: replaced
#
# After state:
# ------------
#
#sonic(config)# do show tacacs-server
#---------------------------------------------------------
#TACACS Global Configuration
#---------------------------------------------------------
#source-interface : Ethernet12
#timeout : 10
#auth-type : pap
#key configured : Yes
#--------------------------------------------------------------------------------------
#HOST AUTH-TYPE KEY-CONFIG PORT PRIORITY TIMEOUT VRF
#--------------------------------------------------------------------------------------
#1.2.3.4 mschap Yes 49 1 5 default
#
# Using overridden
#
# Before state:
# -------------
#
#sonic(config)# do show tacacs-server
#---------------------------------------------------------
#TACACS Global Configuration
#---------------------------------------------------------
#source-interface : Ethernet12
#timeout : 10
#auth-type : pap
#key configured : Yes
#--------------------------------------------------------------------------------------
#HOST AUTH-TYPE KEY-CONFIG PORT PRIORITY TIMEOUT VRF
#--------------------------------------------------------------------------------------
#1.2.3.4 pap No 49 1 5 default
#11.12.13.14 chap Yes 49 10 5 default
#
- name: Override tacacs configurations
sonic_tacacs_server:
config:
auth_type: mschap
key: mschap
source_interface: Ethernet12
timeout: 20
servers:
- host:
name: 1.2.3.4
auth_type: mschap
key: mschap
- host:
name: 10.10.11.12
auth_type: chap
timeout: 30
priority: 2
state: overridden
#
# After state:
# ------------
#
#sonic(config)# do show tacacs-server
#---------------------------------------------------------
#TACACS Global Configuration
#---------------------------------------------------------
#source-interface : Ethernet12
#timeout : 20
#auth-type : mschap
#key configured : Yes
#--------------------------------------------------------------------------------------
#HOST AUTH-TYPE KEY-CONFIG PORT PRIORITY TIMEOUT VRF
#--------------------------------------------------------------------------------------
#1.2.3.4 mschap Yes 49 1 5 default
#10.10.11.12 chap No 49 2 30 default
#
返回值
常见返回值记录在 此处,以下是此模块特有的字段
键 |
描述 |
---|---|
生成的配置模块调用。 返回: 当发生更改时 示例: |
|
模块调用之前的配置。 返回: 始终 示例: |
|
推送到远程设备的命令集。 返回: 始终 示例: |