Skip to content

Commit ac09bcd

Browse files
committed
Added 'src/adv_network/platform_options/nxos.md'.
1 parent b287e5a commit ac09bcd

File tree

7 files changed

+386
-1
lines changed

7 files changed

+386
-1
lines changed

network_run/enable_nx-api.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
- hosts: nxos-sw
3+
gather_facts: no
4+
5+
tasks:
6+
- name: Enable NX-API
7+
cisco.nxos.nxos_nxapi:
8+
enable_https: yes

src/SUMMARY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@
200200
- [IOS 平台选项](adv_network/platform_options/icx.md)
201201
- [IronWare 平台选项](adv_network/platform_options/ironware.md)
202202
- [Junos OS 平台选项](adv_network/platform_options/junos.md)
203+
- [Meraki 平台选项](adv_network/platform_options/meraki.md)
204+
- [Pluribus NETVISOR 平台选项](adv_network/platform_options/meraki.md)
205+
- [NOS 平台选项](adv_network/platform_options/nos.md)
203206

204207
---
205208

src/adv_network/platform_options/junos.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,86 @@
1313
| 间接访问 | 使用堡垒机(跳转主机) | 使用堡垒机(跳转主机) |
1414
| 连接设置 | `ansible_connection: ansible.netcommon.network_cli` | `ansible_connection: ansible.netcommon.netconf` |
1515
| `enable` 模式(权限提升) | 不受 Junos OS 支持 | 不受 Junos OS 支持 |
16-
| 返回数据格式 | `stdout[0].` | <li>json: <code>result[0]['software-information'][0]['host-name'][0]['data'] foo lo0</code></li><li>text: <code>result[1].software-information[0].physical-interface[0].name[0].data foo lo0</code></li><li>xml: <code>result[1].rpc-reply.interface-information[0].physical-interface[0].name[0].data foo lo0</code></li>
16+
| 返回数据格式 | `stdout[0].` | <li>json: <code>result[0]['software-information'][0]['host-name'][0]['data'] foo lo0</code></li><li>text: <code>result[1].interface-information[0].physical-interface[0].name[0].data foo lo0</code></li><li>xml: <code>result[1].rpc-reply.interface-information[0].physical-interface[0].name[0].data foo lo0</code></li>
1717

1818

1919
`ansible_connection: local` 已被弃用。请使用 `ansible_connection: ansible.netcommon.netconf``ansible_connection=ansible.netcommon.network_cli` 代替。
20+
21+
22+
## 在 Ansible 中使用 CLI
23+
24+
### 示例 CLI 仓库变量 `[junos:vars]`
25+
26+
27+
```ini
28+
[junos:vars]
29+
ansible_connection=ansible.netcommon.network_cli
30+
ansible_network_os=junipernetworks.junos.junos
31+
ansible_user=myuser
32+
ansible_password=!vault...
33+
ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -q bastion01"'
34+
```
35+
36+
37+
{{#include ./ce.md:43:45}}
38+
39+
40+
### 示例 CLI 任务
41+
42+
43+
```yaml
44+
- name: Retrieve Junos OS version
45+
junipernetworks.junos.junos_command:
46+
commands: show version
47+
when: ansible_network_os == 'junipernetworks.junos.junos'
48+
```
49+
50+
51+
## 在 Ansible 中使用 NETCONF
52+
53+
### 启用 NETCONF
54+
55+
56+
在咱们可以使用 NETCONF 连接交换机前,咱们必须:
57+
58+
- 使用 `pip install ncclient`(`python -m pip install ncclient`)命令,在控制节点上安装 `ncclient` 这个 python 软件包;
59+
- 在 Junos OS 设备上启用 NETCONF。
60+
61+
62+
要经由 Ansible 在新交换机上启用 NETCONF,就要通过 CLI 连接使用 `junipernetworks.junos.junos_netconf` 这个模组。像上面的 CLI 示例中一样,设置咱们平台级变量,然后运行一个如下的 playbook 任务:
63+
64+
65+
```yaml
66+
- name: Enable NETCONF
67+
connection: ansible.netcommon.network_cli
68+
junipernetworks.junos.junos_netconf:
69+
when: ansible_network_os == 'junipernetworks.junos.junos'
70+
```
71+
72+
启用 NETCONF 后,就要修改咱们的变量,以使用 NETCONF 连接。
73+
74+
75+
### 示例 NETCONF 仓库的 `[junos:vars]`
76+
77+
78+
```ini
79+
[junos:vars]
80+
ansible_connection=ansible.netcommon.netconf
81+
ansible_network_os=junipernetworks.junos.junos
82+
ansible_user=myuser
83+
ansible_password=!vault |
84+
ansible_ssh_common_args='-o ProxyCommand="ssh -W %h:%p -q bastion01"'
85+
```
86+
87+
88+
### 示例 NETCONF 任务
89+
90+
```yaml
91+
- name: Backup current switch config (junos)
92+
junipernetworks.junos.junos_config:
93+
backup: yes
94+
register: backup_junos_location
95+
when: ansible_network_os == 'junipernetworks.junos.junos'
96+
```
97+
98+
{{#include ./ce.md:193:}}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Meraki 平台选项
2+
3+
[`cisco.meraki`](https://galaxy.ansible.com/ui/repo/published/cisco/meraki) 专辑目前只支持 `local` 的连接类型。
4+
5+
> **译注**:Cisco Meraki 是一家云管理 IT 公司,总部位于加利福尼亚州旧金山。其产品包括无线、交换、安全、企业移动管理,enterprise mobility management, EMM,及安全摄像头,所有产品均可通过网络集中管理。Meraki 于 2012 年 12 月被思科系统公司收购,成为其的一家子公司。
6+
>
7+
>
8+
> 参考:
9+
>
10+
> - [Cisco Meraki](https://en.wikipedia.org/wiki/Cisco_Meraki)
11+
12+
## 可用连接
13+
14+
15+
| | 仪表板 Dashboard API |
16+
| 协议 | HTTPS |
17+
| 凭据 | 使用仪表板中的 API 密钥 |
18+
| 连接设置 | `ansible_connection: local` |
19+
| 返回数据格式 | `data.` |
20+
21+
22+
## 示例 Meraki 任务
23+
24+
```yaml
25+
cisco.meraki.meraki_organization:
26+
auth_key: abc12345
27+
org_name: YourOrg
28+
state: present
29+
delegate_to: localhost
30+
```
31+
32+
(End)
33+
34+
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Pluribus NETVISOR 平台选项
2+
3+
4+
Pluribus NETVISOR Ansible 是 [`community.network`](https://galaxy.ansible.com/ui/repo/published/community/network) 专辑的一部分,目前仅支持 CLI 连接。未来可能会添加 `httpapi` 模组。本页提供了有关如何在 Ansible 中于 NETVISOR 上使用 `ansible.netcommon.network_cli` 的详细介绍。
5+
6+
7+
> **译注**:Pluribus 网络技术已被 Arista 于 2022 年 8 月收购。Pluribus NetVisor 操作系统、UNUM(管理)软件、Pluribus Freedom 9000 系列 10G、25G 及 100G 开放网络交换机家族等都已停售、停止支持,生命周期结束。
8+
>
9+
>
10+
> 参考:
11+
>
12+
> - [Networking/ONIE/NOS Status](https://www.opencompute.org/wiki/Networking/ONIE/NOS_Status)
13+
>
14+
> - [Arista Networks](https://en.wikipedia.org/wiki/Arista_Networks)
15+
>
16+
> - [Pluribus Networks Resources](https://www.arista.com/en/support/pluribus-resources)
17+
18+
19+
## 可用连接
20+
21+
| | `CLI` |
22+
| :-- | :-- |
23+
| 协议 | SSH |
24+
| 凭据 | 在存在 SSH 密钥/ `ssh-agent` 时使用 SSH 密钥/`ssh-agent`,在使用密码时接受 `-u my_user -k` 参数 |
25+
| 间接访问 | 通过堡垒机(跳转主机) |
26+
| 连接设置 | `ansible_connection: ansible.netcommon.network_cli` |
27+
| `enable` 模式(权限提升) | 不受 NETVISOR 支持 |
28+
| 返回数据格式 | `stdout[0].` |
29+
30+
Pluribus NETVISOR 不支持 `ansible_connection: local`。咱们必须使用 `ansible_connection: ansible.netcommon.network_cli`
31+
32+
33+
## 在 Ansible 中使用 CLI
34+
35+
36+
### 示例 CLI `group_vars/netvisor.yml`
37+
38+
39+
```yaml
40+
ansible_connection: ansible.netcommon.network_cli
41+
ansible_network_os: community.netcommon.netvisor
42+
ansible_user: myuser
43+
ansible_password: !vault...
44+
ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q bastion01"'
45+
```
46+
47+
{{#include ./ce.md:43:45}}
48+
49+
50+
### 示例 CLI 任务
51+
52+
```yaml
53+
- name: Create access list
54+
community.network.pn_access_list:
55+
pn_name: "foo"
56+
pn_scope: "local"
57+
state: "present"
58+
register: acc_list
59+
when: ansible_network_os == 'community.network.netvisor'
60+
```
61+
62+
63+
64+
{{#include ./ce.md:193:}}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# NOS 平台选项
2+
3+
4+
Extreme NOS 是 `community.network` 专辑的一部分,目前仅支持 CLI 连接。未来可能会添加 `httpapi` 模组。本页详细提供了关于如何在 Ansible 中于 NOS 上使用 `ansible.netcommon.network_cli` 的详细介绍。
5+
6+
> **译注**:Extreme NOS 是 [Extreme Networks](https://www.extremenetworks.com/) 公司搭载于其生产设备上的网络操作系统。
7+
>
8+
> 参考:
9+
>
10+
> - [Network OS (software)](https://supportdocs.extremenetworks.com/support/documentation/network-os-software-7-3-0/)
11+
12+
13+
## 可用连接
14+
15+
16+
| | `CLI` |
17+
| :-- | :-- |
18+
| 协议 | SSH |
19+
| 凭据 | 在存在 SSH 密钥/ `ssh-agent` 时使用 SSH 密钥/`ssh-agent`,在使用密码时接受 `-u my_user -k` 参数 |
20+
| 间接访问 | 通过堡垒机(跳转主机) |
21+
| 连接设置 | `ansible_connection: ansible.netcommon.network_cli` |
22+
| `enable` 模式(权限提升) | 不受 NOS 支持 |
23+
| 返回数据格式 | `stdout[0].` |
24+
25+
26+
NOS 不支持 `ansible_connection: local`。咱们必须使用 `ansible_connection: ansible.netcommon.network_cli`
27+
28+
29+
## 在 Ansible 中使用 CLI
30+
31+
32+
### 示例 CLI `group_vars/nos.yml`
33+
34+
```yaml
35+
ansible_connection: ansible.netcommon.network_cli
36+
ansible_network_os: community.network.nos
37+
ansible_user: myuser
38+
ansible_password: !vault...
39+
ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q bastion01"'
40+
```
41+
42+
{{#include ./ce.md:43:45}}
43+
44+
45+
### 示例 CLI 任务
46+
47+
```yaml
48+
- name: Get version information (nos)
49+
community.network.nos_command:
50+
commands: "show version"
51+
register: show_ver
52+
when: ansible_network_os == 'community.network.nos'
53+
```
54+
55+
56+
57+
{{#include ./ce.md:193:}}

0 commit comments

Comments
 (0)