cisco.iosxr.iosxr_system 模块 – 用于管理系统属性的模块。
注意
此模块是 cisco.iosxr 集合(版本 10.2.2)的一部分。
如果您使用的是 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install cisco.iosxr
。您需要满足其他要求才能使用此模块,有关详细信息,请参阅要求。
要在 playbook 中使用它,请指定:cisco.iosxr.iosxr_system
。
cisco.iosxr 1.0.0 中的新增功能
概要
此模块提供 Cisco IOS XR 设备上节点系统属性的声明式管理。它提供配置主机系统参数或从设备活动配置中删除这些参数的选项。
要求
执行此模块的主机需要满足以下要求。
使用 netconf 时需要 ncclient >= 0.5.3
使用 netconf 时需要 lxml >= 4.1.1
参数
参数 |
注释 |
---|---|
将远程设备上的 IP 域名配置为提供的值。该值应为点分名称形式,并将附加到 |
|
提供要附加到主机名的域名后缀列表,以进行名称解析。此参数接受名称列表,并将与运行节点上的当前活动配置进行协调。 |
|
配置设备主机名参数。此选项采用 ASCII 字符串值。 |
|
提供启用或禁用 DNS 查找的管理控制。当此参数设置为 True 时,将执行查找;当设置为 False 时,不执行查找。 选择
|
|
|
|
|
|
设备当前活动配置中配置值的状态。当设置为 present 时,这些值应在设备活动配置中配置;当设置为 absent 时,这些值不应在设备活动配置中。 选择
|
|
域服务的 VRF 名称 默认值: |
注意
注意
此模块使用
network_cli
和netconf
连接工作。请参阅IOS-XR 平台选项。使用
netconf
传输的名称服务器 state=absent 操作成功,但会出现 rpc-error。这是由于 XR 平台问题。建议将 ignore_errors 选项与任务一起使用作为解决方法。有关使用 Ansible 管理网络设备的更多信息,请参阅 :ref:`Ansible 网络指南
` 有关使用 Ansible 管理 Cisco 设备的更多信息,请参阅 `Cisco 集成页面 <https://ansible.org.cn/integrations/networks/cisco>`_。
示例
- name: configure hostname and domain-name (default vrf=default)
cisco.iosxr.iosxr_system:
hostname: iosxr01
domain_name: test.example.com
domain_search:
- ansible.com
- redhat.com
- cisco.com
- name: remove configuration
cisco.iosxr.iosxr_system:
hostname: iosxr01
domain_name: test.example.com
domain_search:
- ansible.com
- redhat.com
- cisco.com
state: absent
- name: configure hostname and domain-name with vrf
cisco.iosxr.iosxr_system:
hostname: iosxr01
vrf: nondefault
domain_name: test.example.com
domain_search:
- ansible.com
- redhat.com
- cisco.com
- name: configure DNS lookup sources
cisco.iosxr.iosxr_system:
lookup_source: MgmtEth0/0/CPU0/0
lookup_enabled: true
- name: configure name servers
cisco.iosxr.iosxr_system:
name_servers:
- 8.8.8.8
- 8.8.4.4
返回值
此处记录了常见的返回值here,以下是此模块独有的字段
键 |
描述 |
---|---|
要发送到设备的配置模式命令列表 已返回: 始终 示例: |
|
通过 返回: 总是返回 (当没有 xml rpc 发送时返回空列表) 示例: |