Skip to content

Commit 5053ac4

Browse files
committed
Added 'src/adv_network/platform_options/ios-xr.md'.
1 parent 21e5221 commit 5053ac4

File tree

7 files changed

+251
-3
lines changed

7 files changed

+251
-3
lines changed

src/SUMMARY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@
194194
- [ENOS 平台选项](adv_network/platform_options/enos.md)
195195
- [EOS 平台选项](adv_network/platform_options/eos.md)
196196
- [`ERIC_ECCLI` 平台选项](adv_network/platform_options/eric_eccli.md)
197+
- [`EXOS` 平台选项](adv_network/platform_options/exos.md)
198+
- [FRR 平台选项](adv_network/platform_options/frr.md)
199+
- [ICX 平台选项](adv_network/platform_options/icx.md)
200+
- [IOS 平台选项](adv_network/platform_options/icx.md)
197201

198202
---
199203

src/adv_network/platform_options/ce.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ CloudEngine CE OS 属于 [`community.network`](https://galaxy.ansible.com/ui/rep
2929

3030
`ansible_connection: local` 已被弃用。请使用 `ansible_connection: ansible.netcommon.netconf``ansible_connection=ansible.netcommon.network_cli` 代替。
3131

32-
3332
## 示例 CLI 仓库 `[ce:vars]`
3433

3534
```ini

src/adv_network/platform_options/cnos.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ CNOS 是 `community.network` 专辑的一部分,支持 `enable` 模式(权
2828
| `enable` 模式(权限提升) | 受支持的:与 `ansible_become_method: enable``ansible_become_password:` 一起使用 `ansible_become: true` |
2929
| 返回数据格式 | `stdout[0].` |
3030

31-
32-
`ansible_connection: local` 已被弃用。使用 `ansible_connection: ansible.netcommon.network_cli` 代替。
31+
`ansible_connection: local` 已被弃用。请使用 `ansible_connection: ansible.netcommon.network_cli` 代替。
3332

3433
## 在 Ansible 中使用 `CLI`
3534

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# FRR 平台选项
2+
3+
4+
[`FRR` 专辑](https://galaxy.ansible.com/ui/repo/published/frr/frr) 支持 `ansible.netcommon.network_cli` 连接。本节提供了有关如何将这种连接,用于自由范围路由,Free Range Routing,FRR,的详细介绍。
5+
6+
7+
> **译注**[FRRouting](https://frrouting.org/),是linux 基金会的合作项目,a Linux foundation collaborative project。代码仓库 [FRRouting/frr](https://github.com/FRRouting/frr)
8+
9+
10+
## 可用连接
11+
12+
| | `CLI` |
13+
| :-- | :-- |
14+
| 协议 | SSH |
15+
| 凭据 | 在存在 SSH 密钥/ `ssh-agent` 时使用 SSH 密钥/`ssh-agent`,在使用密码时接受 `-u my_user -k` 参数 |
16+
| 间接访问 | 通过堡垒机(跳转主机) |
17+
| 连接设置 | `ansible_connection: ansible.netcommon.network_cli` |
18+
| `enable` 模式(权限提升) | 不支持 |
19+
| 返回数据格式 | `stdout[0].` |
20+
21+
22+
## 在 Ansible 中使用 CLI
23+
24+
25+
### 示例 CLI `group_vars/frr.yml`
26+
27+
28+
```yaml
29+
ansible_connection: ansible.netcommon.network_cli
30+
ansible_network_os: frr.frr.frr
31+
ansible_user: frruser
32+
ansible_password: !vault...
33+
ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q bastion01"'
34+
```
35+
36+
37+
- `ansible_user` 应属于 `frrvty` 组,且默认 shell 应被设置为 `/bin/vtysh`;
38+
{{#include ./ce.md:43:45}}
39+
40+
41+
### 示例 CLI 任务
42+
43+
```yaml
44+
- name: Gather FRR facts
45+
frr.frr.frr_facts:
46+
gather_subset:
47+
- config
48+
- hardware
49+
```
50+
51+
52+
53+
{{#include ./ce.md:193:}}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# ICX 平台选项
2+
3+
ICX 是 [`community.network`]() 专辑的一部分,支持 `enable` 模式(权限提升)。本页提供了有关在 Ansible 中于 ICX 上使用 `enable` 模式的详细介绍。
4+
5+
6+
> **译注**:ICX 平台是搭载于康普 Commscope 旗下有线及无线网络设备与软件品牌 RUCKUS Networks 交换机的网络操作系统。
7+
>
8+
>
9+
>
10+
> 参考:
11+
>
12+
> - [RUCKUS ICX FastIron 10.0.10f_cd1 (GA) Software Release (.zip)](https://support.ruckuswireless.com/software/4396-ruckus-icx-fastiron-10-0-10f_cd1-ga-software-release-zip)
13+
14+
15+
## 可用连接
16+
17+
{{#include ./cnos.md:22:31}}
18+
19+
20+
## 在 Ansible 中使用 CLI
21+
22+
23+
### 示例 CLI `group_vars/icx.yml`
24+
25+
26+
```yaml
27+
ansible_connection: ansible.netcommon.network_cli
28+
ansible_network_os: community.network.icx
29+
ansible_user: myuser
30+
ansible_password: !vault...
31+
ansible_become: true
32+
ansible_become_method: enable
33+
ansible_become_password: !vault...
34+
ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q bastion01"'
35+
```
36+
37+
38+
{{#include ./ce.md:43:45}}
39+
40+
41+
### 示例 CLI 任务
42+
43+
44+
```yaml
45+
- name: Backup current switch config (icx)
46+
community.network.icx_config:
47+
backup: yes
48+
register: backup_icx_location
49+
when: ansible_network_os == 'community.network.icx'
50+
```
51+
52+
53+
54+
{{#include ./ce.md:193:}}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# IOS-XR 平台选项
2+
3+
[思科 IOS-XR 专辑](https://galaxy.ansible.com/ui/repo/published/cisco/iosxr) 专辑支持多种连接。本页提供了有关每种连接在 Ansible 中工作原理及使用方法的详细介绍。
4+
5+
6+
## 可用连接
7+
8+
9+
| | CLI | NETCONF,仅限于 `iosxr_banner``iosxr_interface``iosxr_logging``iosxr_system``ios_user` 模组 |
10+
| 协议 | SSH | 透过 SSH 的 XML |
11+
| 凭据 | 若存在 SSH 密钥/ `ssh-agent`,则使用 SSH 密钥/ `ssh-agent`,若使用密码,则接受 `-u my_user -k` | 若存在 SSH 密钥/ `ssh-agent`,则使用 SSH 密钥/ `ssh-agent`,若使用密码,则接受 `-u my_user -k` |
12+
| 间接访问 | 使用堡垒机(跳转主机) | 使用堡垒机(跳转主机) |
13+
| 连接设置 | `ansible_connection: ansible.netcommon.network_cli` | `ansible_connection: ansible.netcommon.netconf` |
14+
| `enable` 模式(权限提升) | 不支持 | 不支持 |
15+
| 返回数据格式 | 请参考单独模组文档 | 请参考单独模组文档 |
16+
17+
18+
`ansible_connection: local` 已被弃用。请使用 `ansible_connection: ansible.netcommon.netconf``ansible_connection=ansible.netcommon.network_cli` 代替。
19+
20+
21+
## 在 Ansible 中使用 CLI
22+
23+
### 示例 CLI 仓库 `[iosxr:vars]`
24+
25+
```ini
26+
[iosxr:vars]
27+
ansible_connection=ansible.netcommon.network_cli
28+
ansible_network_os=cisco.iosxr.iosxr
29+
ansible_user=myuser
30+
ansible_password=!vault...
31+
ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -q bastion01"'
32+
```
33+
34+
{{#include ./ce.md:43:45}}
35+
36+
37+
### 示例 CLI 任务
38+
39+
```yaml
40+
- name: Retrieve IOS-XR version
41+
cisco.iosxr.iosxr_command:
42+
commands: show version
43+
when: ansible_network_os == 'cisco.iosxr.iosxr'
44+
```
45+
46+
47+
## 在 Ansible 中使用 NETCONF
48+
49+
50+
### 启用 NETCONF
51+
52+
在咱们使用 NETCONF 连接交换机前,咱们必须:
53+
54+
- 使用 `pip install ncclient` 命令,在控制节点上安装 `ncclient` 这个 python 软件包;
55+
- 在思科 IOS-XR 设备上启用 NETCONF。
56+
57+
58+
要在 Ansible 下于某个新交换机上启用 NETCONF,可通过 CLI 连接使用 `cisco.iosxr.iosxr_netconf` 模组。像上面的 CLI 示例一样,设置咱们的平台级变量,然后运行一个如下的 playbook 任务:
59+
60+
61+
```yaml
62+
- name: Enable NETCONF
63+
connection: ansible.netcommon.network_cli
64+
cisco.iosxr.iosxr_netconf:
65+
when: ansible_network_os == 'cisco.iosxr.iosxr'
66+
```
67+
68+
在 NETCONF 启用后,就要把咱们的变量修改为使用 NETCONF 连接。
69+
70+
71+
### 示例 NETCONF 仓库 `[iosxr:vars]`
72+
73+
74+
```ini
75+
[iosxr:vars]
76+
ansible_connection=ansible.netcommon.netconf
77+
ansible_network_os=cisco.iosxr.iosxr
78+
ansible_user=myuser
79+
ansible_password=!vault |
80+
ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -q bastion01"'
81+
```
82+
83+
84+
### 示例 NETCONF 任务
85+
86+
```yaml
87+
- name: Configure hostname and domain-name
88+
cisco.iosxr.iosxr_system:
89+
hostname: iosxr01
90+
domain_name: test.example.com
91+
domain_search:
92+
- ansible.com
93+
- redhat.com
94+
- cisco.com
95+
```
96+
97+
{{#include ./ce.md:193:}}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# IOS 平台选项
2+
3+
[Cisco IOS](https://galaxy.ansible.com/ui/repo/published/cisco/ios) 专辑支持 `enable` 模式(特权升级)。此页面提供了有关如何在 Ansible 中于 iOS 上使用 `enable` 模式的详细信息。
4+
5+
## 可用连接
6+
7+
8+
{{#include ./cnos.md:22:31}}
9+
10+
11+
## 在 Ansible 中使用 CLI
12+
13+
### 示例 CLI `group_vars/ios.yml`
14+
15+
16+
```yaml
17+
ansible_connection: ansible.netcommon.network_cli
18+
ansible_network_os: cisco.ios.ios
19+
ansible_user: myuser
20+
ansible_password: !vault...
21+
ansible_become: true
22+
ansible_become_method: enable
23+
ansible_become_password: !vault...
24+
ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q bastion01"'
25+
```
26+
27+
{{#include ./ce.md:43:45}}
28+
29+
30+
### 示例 CLI 任务
31+
32+
```yaml
33+
- name: Backup current switch config (ios)
34+
cisco.ios.ios_config:
35+
backup: yes
36+
register: backup_ios_location
37+
when: ansible_network_os == 'cisco.ios.ios'
38+
```
39+
40+
41+
42+
{{#include ./ce.md:193:}}

0 commit comments

Comments
 (0)