community.network.ce_netconf 模块 – 在华为CloudEngine交换机上运行任意Netconf命令。
注意
此模块是community.network 集合 (版本 5.1.0)的一部分。
如果您使用的是ansible
软件包,则可能已经安装了此集合。它不包含在ansible-core
中。要检查是否已安装,请运行ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.network
。
要在playbook中使用它,请指定:community.network.ce_netconf
。
注意
community.network 集合已被弃用,并将从 Ansible 12 中移除。有关更多信息,请参见讨论主题。
已弃用
- 在以下版本中移除:
6.0.0版本
- 原因:
此集合及其中的所有内容均未维护且已弃用。
- 替代方案:
未知。
概要
在华为CloudEngine交换机上发送任意Netconf命令。
别名:network.cloudengine.ce_netconf
参数
参数 |
注释 |
---|---|
配置xml字符串。 |
|
rpc的类型。 选项
|
备注
注意
此模块要求在被管理的远程设备上启用netconf系统服务。
推荐的连接是
netconf
。此模块也适用于旧版playbook的
local
连接。
示例
- name: CloudEngine netconf test
hosts: cloudengine
connection: local
gather_facts: false
tasks:
- name: "Netconf get operation"
community.network.ce_netconf:
rpc: get
cfg_xml: '<filter type="subtree">
<vlan xmlns="http://www.huawei.com/netconf/vrp" content-version="1.0" format-version="1.0">
<vlans>
<vlan>
<vlanId>10</vlanId>
<vlanif>
<ifName></ifName>
<cfgBand></cfgBand>
<dampTime></dampTime>
</vlanif>
</vlan>
</vlans>
</vlan>
</filter>'
- name: "Netconf edit-config operation"
community.network.ce_netconf:
rpc: edit-config
cfg_xml: '<config>
<aaa xmlns="http://www.huawei.com/netconf/vrp" content-version="1.0" format-version="1.0">
<authenticationSchemes>
<authenticationScheme operation="create">
<authenSchemeName>default_wdz</authenSchemeName>
<firstAuthenMode>local</firstAuthenMode>
<secondAuthenMode>invalid</secondAuthenMode>
</authenticationScheme>
</authenticationSchemes>
</aaa>
</config>'
- name: "Netconf execute-action operation"
community.network.ce_netconf:
rpc: execute-action
cfg_xml: '<action>
<l2mc xmlns="http://www.huawei.com/netconf/vrp" content-version="1.0" format-version="1.0">
<l2McResetAllVlanStatis>
<addrFamily>ipv4unicast</addrFamily>
</l2McResetAllVlanStatis>
</l2mc>
</action>'
返回值
常见的返回值已在此处记录,以下是此模块独有的字段
键 |
描述 |
---|---|
检查设备上是否进行了更改 返回值:始终 示例: |
|
模块执行后aaa参数的键值对 返回值:始终 示例: |
状态
此模块将在6.0.0版本中移除。[已弃用]
有关更多信息,请参见已弃用。