Skip to content

Commit 27f504f

Browse files
committed
Update Docs & Update License & Remove hostname from OSPF class
1 parent 94a9fc4 commit 27f504f

10 files changed

+667
-10
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Dylan Hamel
3+
Copyright (c) 2020 Dylan Hamel
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

docs/configuration.md

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
It is possible to define which protocol will be tested. It's not an obligation to execute some tests on all protocols supported by Netests.io.
2+
3+
To define which test will be executed you have to create a netests configuration file.
4+
5+
By default its name is `netests.yml`
6+
7+
8+
9+
## Configuration file
10+
11+
```yaml
12+
config:
13+
protocols:
14+
bgp:
15+
test: true
16+
17+
bgp_all_up:
18+
test: false
19+
20+
cdp:
21+
test: false
22+
23+
facts:
24+
test: true
25+
26+
lldp:
27+
test: false
28+
29+
ospf:
30+
test: false
31+
32+
vrf:
33+
test: true
34+
35+
```
36+
37+
> File can be specified when you are running Netests.io from the CLI
38+
>
39+
> ```shell
40+
> Options:
41+
> -a, --netest-config-file TEXT Path to Netests configuration file
42+
> [default: netests.yml]
43+
> ```
44+
45+
46+
47+
### Enable a protocol
48+
49+
Juste put `test: true` for the protocol.
50+
51+
For example to enable `lldp`
52+
53+
```yaml
54+
lldp:
55+
test: false
56+
```
57+
58+
59+
60+
### Disable a protocol
61+
62+
Juste put `test: false` for the protocol.
63+
64+
For example to enable `lldp`
65+
66+
```yaml
67+
lldp:
68+
test: false
69+
```
70+
71+
72+
73+
### Enable protocol for only one device
74+
75+
Sometime it can be useful to test a protocol only for one device.
76+
77+
Currently it is not possible to filter a protocol by `host` or `group` BUT there is a possibilty to bypass test.
78+
79+
> If there is no source of truth for a specific protocol for a device the test will be true.
80+
81+
82+
83+
#### Example
84+
85+
The goal is to execute LLDP test only on `leaf01` but not on `leaf02`.
86+
87+
1. Enable LLDP for all devices
88+
89+
```yaml
90+
config:
91+
protocols:
92+
lldp:
93+
test: true
94+
```
95+
96+
Create a source of truth only for `leaf01`.
97+
98+
```shell
99+
truth_vars
100+
├── all
101+
│   └── ping.yml
102+
└── hosts
103+
├── leaf01
104+
│   ├── lldp.yml
105+
│   └── ping.yml
106+
├── leaf02
107+
    └── ping.yml
108+
109+
```
110+
111+
Given that `leaf02` has not source of truth for LLDP the result will be **true**.
112+

docs/index.md docs/introduction.md

+9
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ If the two results are the same, Netests will return a success, otherwise a fail
4747

4848

4949

50+
Netests.io can connect to the device with `Netconf`, `ssh`, over a `rest api` and with `NAPALM` if the vendor is supported by NAPALM.
51+
52+
Not all connexion type are available for all devices. Some vendors don't support Netconf or REST API.
53+
54+
Please before to start have a look on ``vendors_and_protocols``.
55+
56+
57+
5058
## Way of working
5159

5260
The network engineer job is evolving and the ways of working too.
@@ -148,6 +156,7 @@ With network the steps are a bit differents. The verification will not be done d
148156
'vrf': {
149157
Host: leaf02: True
150158
},
159+
}
151160
```
152161

153162
> Protocols with a "None" is the protocols that had not been tested

docs/inventory.md

+204-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,189 @@
1-
## Inventory
1+
Based on Ansible or Nornir inventory (Netbox is coming). You have to specify which inventory type will be used in the Netests.io running command :
22

3-
Based on Ansible or Nornir inventory (netbox is coming)
43

54

5+
### Ansible Inventory
6+
7+
```shell
8+
netests -x -i inventory/ansible/hosts
9+
```
10+
11+
```shell
12+
-x, --ansible-inventory Specify that an Ansible inventory will be
13+
used.
14+
```
15+
16+
With Ansible inventory the variables defined in `host_vars`, `group_vars` will be retrieved.
17+
18+
```shell
19+
⚡ cat inventory/ansible/hosts
20+
[leaf]
21+
leaf01
22+
leaf02
23+
leaf03
24+
leaf04
25+
leaf05
26+
27+
[spine]
28+
spine01
29+
spine02
30+
spine03
31+
32+
⚡ tree inventory/ansible
33+
inventory/ansible
34+
├── group_vars
35+
│ ├── leaf.yml
36+
│ ├── spine.yml
37+
│   └── all.yml
38+
├── host_vars
39+
│   ├── leaf01.yml
40+
│   ├── leaf02.yml
41+
│   ├── leaf03.yml
42+
│   ├── leaf04.yml
43+
│   ├── leaf05.yml
44+
│   ├── spine02.yml
45+
│   └── spine03.yml
46+
└── hosts
47+
```
48+
49+
50+
51+
### Nornir inventory
52+
53+
```shell
54+
netests -z -i inventory/nornir/config.yml
55+
```
56+
57+
```yaml
58+
-z, --nornir-inventory Specify that an Nornir inventory will be
59+
used.
60+
```
61+
62+
63+
64+
### Netbox inventory
65+
66+
> Not supported yet
67+
68+
```shell
69+
-y, --netbox-inventory Specify that an Netbox inventory will be
70+
used.
71+
```
72+
673

7-
### Variables needed
74+
75+
## Variables needed
76+
77+
To establish the connexion to the device you have to define many differents variables :
78+
79+
* `hostname:` = device IP addresse or hostname to reach its
80+
* `username:`
81+
* `password:`
82+
* `connexion:` = Which protocol using to connect to the device
83+
* `port:`
84+
* `secure_api` (depends of connexion type)
85+
86+
87+
88+
### Hostname
89+
90+
List of device type by platform key.
91+
92+
##### Arista Networks
93+
94+
```yaml
95+
platform: eos
96+
```
97+
98+
##### Cumulus Networks
99+
100+
```yaml
101+
platform: linux
102+
```
103+
104+
##### Extreme Networks VSP (VOSS)
105+
106+
```yaml
107+
platform: extreme_vsp
108+
```
109+
110+
##### Cisco IOS / IOS-XE
111+
112+
```yaml
113+
platform: ios
114+
```
115+
116+
##### Cisco IOS-XR
117+
118+
```yaml
119+
platform: iosxr
120+
```
121+
122+
##### Cisco IOS / IOS-XE
123+
124+
```yaml
125+
platform: nxos
126+
```
127+
128+
129+
130+
### Connexion
131+
132+
You have to define in your inventory how Netests.io will connect to devices.
133+
There are actually 3 possibilities:
134+
135+
* REST API
136+
137+
```yaml
138+
connexion: api
139+
secure_api: true # => https://
140+
secure_api: false # => http://
141+
```
142+
143+
* NETCONF
144+
145+
```yaml
146+
connexion: netconf
147+
```
148+
149+
* SSH
150+
151+
```yaml
152+
connexion: ssh
153+
```
154+
155+
156+
157+
## Examples
158+
159+
Here some examples with an Ansible inventory about how structure it.
160+
161+
#### For each hosts
162+
163+
* Juniper Networks / `leaf04 ` => `host_vars/leaf01.yml`
164+
165+
```yaml
166+
hostname: 172.16.194.52
167+
platform: junos
168+
username: juiper
169+
password: MyJuniper
170+
connexion: netconf
171+
port: 830
172+
```
173+
174+
* Cisco NX-OS/ `leaf02 `=> `host_vars/leaf02.yml`
175+
176+
```yaml
177+
hostname: 172.16.194.53
178+
platform: nxos
179+
username: admin
180+
password: Cisco12345.
181+
connexion: api
182+
port: 443
183+
secure_api: true
184+
```
185+
186+
* Cumulus Networks / `leaf01` / => `host_vars/leaf01.yml`
8187

9188
```yaml
10189
hostname: 172.16.194.51
@@ -15,4 +194,25 @@ connexion: ssh
15194
port: 22
16195
```
17196

18-
> Vault integration (Hashicorp & Ansible-vault is coming)
197+
> Vault integration (Hashicorp & Ansible-vault is coming)
198+
199+
200+
201+
#### With common variables
202+
203+
Same password for all devices => `group_vars/all.yml`
204+
205+
```yaml
206+
username: cumulus
207+
password: CumulusLinux!
208+
```
209+
210+
Same connexion type for all leaves (leaf) => `group_vars/leaf.yml`
211+
212+
```yaml
213+
platform: linux
214+
connexion: api
215+
port: 8080
216+
secure_api: false
217+
```
218+

docs/license.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
11
## License
22

3-
Apache 2
3+
```
4+
MIT License
5+
6+
Copyright (c) 2020 Dylan Hamel
7+
8+
Permission is hereby granted, free of charge, to any person obtaining a copy
9+
of this software and associated documentation files (the "Software"), to deal
10+
in the Software without restriction, including without limitation the rights
11+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
copies of the Software, and to permit persons to whom the Software is
13+
furnished to do so, subject to the following conditions:
14+
15+
The above copyright notice and this permission notice shall be included in all
16+
copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24+
SOFTWARE.
25+
26+
```
27+

0 commit comments

Comments
 (0)