@@ -19,31 +19,38 @@ The features the plugin provides should be listed here.
19
19
| ----------------| ----------------|
20
20
| 3.5 | 0.1.0 |
21
21
22
- ## Installing
22
+ ### Installation
23
23
24
24
For adding to a NetBox Docker setup see
25
25
[ the general instructions for using netbox-docker with plugins] ( https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins ) .
26
26
27
27
While this is still in development and not yet on pypi you can install with pip:
28
28
29
- ``` bash
30
- pip install git+https://github.com/netbox-community/netbox-napalm
29
+ ``` no-highlight
30
+ $ source /opt/netbox/venv/bin/activate
31
+ (venv) pip install git+https://github.com/netbox-community/netbox-napalm
31
32
```
32
33
33
34
or by adding to your ` local_requirements.txt ` or ` plugin_requirements.txt ` (netbox-docker):
34
35
35
- ``` bash
36
- git+https://github.com/netbox-community/netbox-napalm
36
+ ``` no-highlight
37
+ (venv) git+https://github.com/netbox-community/netbox-napalm
37
38
```
38
39
40
+ ### Enable the Plugin
41
+
39
42
Enable the plugin in ` /opt/netbox/netbox/netbox/configuration.py ` ,
40
43
or if you use netbox-docker, your ` /configuration/plugins.py ` file :
41
44
42
45
``` python
43
46
PLUGINS = [
44
- ' Napalm '
47
+ ' netbox_napalm_plugin '
45
48
]
46
49
50
+ # ## Configure Plugin
51
+
52
+ Configure the plugin in `configuration.py` under the `PLUGINS_CONFIG ` parameter.
53
+
47
54
PLUGINS_CONFIG = {
48
55
' netbox_napalm_plugin' : {
49
56
' NAPALM_USERNAME' : ' xxx' ,
@@ -52,6 +59,32 @@ PLUGINS_CONFIG = {
52
59
}
53
60
```
54
61
62
+ ### Run Database Migrations
63
+
64
+ Run the provided schema migrations:
65
+
66
+ ``` no-highlight
67
+ (venv) $ cd /opt/netbox/netbox/
68
+ (venv) $ python3 manage.py migrate
69
+ ```
70
+
71
+ ### Collect Static Files
72
+
73
+ Ensure the static files are copied to the static root directory with the ` collectstatic ` management command:
74
+
75
+ ``` no-highlight
76
+ (venv) $ cd /opt/netbox/netbox/
77
+ (venv) $ python3 manage.py collectstatic
78
+ ```
79
+
80
+ ### Restart WSGI Service
81
+
82
+ Restart the WSGI service to load the new plugin:
83
+
84
+ ``` no-highlight
85
+ # sudo systemctl restart netbox
86
+ ```
87
+
55
88
## Credits
56
89
57
90
Based on the NetBox plugin tutorial:
0 commit comments