community.network.ce_aaa_server 模块 – 管理华为CloudEngine交换机上的AAA服务器全局配置。

注意

此模块是 community.network 集合 (版本 5.1.0) 的一部分。

如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用: ansible-galaxy collection install community.network

要在playbook中使用它,请指定: community.network.ce_aaa_server

注意

community.network 集合已弃用,并将从 Ansible 12 中移除。有关更多信息,请参阅 讨论主题

已弃用

在以下版本中移除:

6.0.0版本

原因:

此集合及其中的所有内容均未维护且已弃用。

替代方案:

未知。

概要

  • 管理华为CloudEngine交换机上的AAA服务器全局配置。

别名:network.cloudengine.ce_aaa_server

参数

参数

注释

accounting_mode

字符串

会计模式。

选项

  • "invalid"

  • "hwtacacs"

  • "radius"

  • "none" ← (默认)

acct_scheme_name

字符串

会计方案名称。值为1到32个字符的字符串。

authen_scheme_name

字符串

身份验证方案名称。值为1到32个字符的字符串。

author_scheme_name

字符串

授权方案名称。值为1到32个字符的字符串。

domain_name

字符串

域名称。值为1到64个字符的字符串。

first_authen_mode

字符串

首选身份验证模式。

选项

  • "invalid"

  • "local" ← (默认)

  • "hwtacacs"

  • "radius"

  • "none"

first_author_mode

字符串

首选授权模式。

选项

  • "invalid"

  • "local" ← (默认)

  • "hwtacacs"

  • "if-authenticated"

  • "none"

hwtacas_template

字符串

HWTACACS模板名称。值为1到32个不区分大小写的字符的字符串。

local_user_group

字符串

用户所属用户组的名称。用户继承用户组的所有权限。值为1到32个字符的字符串。

radius_server_group

字符串

RADIUS服务器组的名称。值为1到32个不区分大小写的字符的字符串。

state

字符串

指定资源的所需状态。

选项

  • "absent"

  • "present" ← (默认)

备注

注意

  • 此模块要求在被管理的远程设备上启用netconf系统服务。

  • 推荐的连接方式为 netconf

  • 此模块也适用于旧版playbook的 local 连接。

示例

- name: AAA server test
  hosts: cloudengine
  connection: local
  gather_facts: false
  vars:
    cli:
      host: "{{ inventory_hostname }}"
      port: "{{ ansible_ssh_port }}"
      username: "{{ username }}"
      password: "{{ password }}"
      transport: cli

  tasks:

  - name: "Radius authentication Server Basic settings"
    community.network.ce_aaa_server:
      state: present
      authen_scheme_name: test1
      first_authen_mode: radius
      radius_server_group: test2
      provider: "{{ cli }}"

  - name: "Undo radius authentication Server Basic settings"
    community.network.ce_aaa_server:
      state: absent
      authen_scheme_name: test1
      first_authen_mode: radius
      radius_server_group: test2
      provider: "{{ cli }}"

  - name: "Hwtacacs accounting Server Basic settings"
    community.network.ce_aaa_server:
      state: present
      acct_scheme_name: test1
      accounting_mode: hwtacacs
      hwtacas_template: test2
      provider: "{{ cli }}"

  - name: "Undo hwtacacs accounting Server Basic settings"
    community.network.ce_aaa_server:
      state: absent
      acct_scheme_name: test1
      accounting_mode: hwtacacs
      hwtacas_template: test2
      provider: "{{ cli }}"

返回值

常见的返回值已在此处记录,以下是此模块特有的字段

描述

changed

布尔值

检查设备上是否进行了更改

返回值:始终返回

示例: true

end_state

字典

模块执行后aaa参数的键值对

返回值:始终返回

示例: {"accounting scheme": [["hwtacacs", "test1"]], "hwtacacs template": ["huawei", "test2"]}

existing

字典

现有aaa服务器的键值对

返回值:始终返回

示例: {"accounting scheme": [["hwtacacs"], ["default"]], "hwtacacs template": ["huawei"]}

proposed

字典

传递到模块的参数的键值对

返回值:始终返回

示例: {"accounting_mode": "hwtacacs", "acct_scheme_name": "test1", "hwtacas_template": "test2", "state": "present"}

updates

列表 / 元素=字符串

发送到设备的命令

返回值:始终返回

示例: ["accounting-scheme test1", "accounting-mode hwtacacs", "hwtacacs server template test2", "hwtacacs enable"]

状态

  • 此模块将在6.0.0版本中移除。 *[已弃用]*

  • 有关更多信息,请参阅 已弃用

作者

  • 王德庄 (@QijunPan)