You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+42-28Lines changed: 42 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,42 @@ The plugin can be used in addition to the built-in script support and does not d
32
32
|----------------|----------------|
33
33
| 3.5 | 0.1.0 |
34
34
35
+
36
+
## Installing
37
+
38
+
Add the plugin to `local_requirements.txt` or `plugin_requirements.txt` (netbox-docker):
39
+
40
+
```
41
+
netbox-script-manager
42
+
```
43
+
44
+
Enable the plugin in `/opt/netbox/netbox/netbox/configuration.py`,
45
+
or if you use netbox-docker, your `/configuration/plugins.py` file:
46
+
47
+
```python
48
+
PLUGINS= [
49
+
'netbox_script_manager'
50
+
]
51
+
52
+
PLUGINS_CONFIG= {
53
+
"netbox_script_manager Manager": {
54
+
"SCRIPT_ROOT": "/path/to/script/folder/",
55
+
"DEFAULT_QUEUE": "high"
56
+
},
57
+
}
58
+
```
59
+
60
+
## Configuration
61
+
62
+
The following options are required:
63
+
64
+
*`SCRIPT_ROOT`: Path to the script folder containing the customscripts module.
65
+
66
+
The following options are optional:
67
+
68
+
*`DEFAULT_QUEUE`: Specifies what queue scripts are run in by default. Defaults to the `default` queue.
69
+
70
+
35
71
## Migrating scripts
36
72
37
73
The most important change is to change the import and name of the base `Script` class.
@@ -88,40 +124,18 @@ A folder structure like this is required (`SCRIPT_ROOT` pointing to the `netboxs
88
124
89
125
The reason for requiring this layout with a `customscripts` folder is to avoid name collisions when dynamically loading scripts. It also makes it easier to clear the internal python module cache which is needed for reloading scripts.
90
126
91
-
## Installing
92
-
93
-
Add the plugin to `local_requirements.txt` or `plugin_requirements.txt` (netbox-docker):
94
-
95
-
```
96
-
netbox-script-manager
97
-
```
98
-
99
-
Enable the plugin in `/opt/netbox/netbox/netbox/configuration.py`,
100
-
or if you use netbox-docker, your `/configuration/plugins.py` file:
101
-
102
-
```python
103
-
PLUGINS= [
104
-
'netbox_script_manager'
105
-
]
106
-
107
-
PLUGINS_CONFIG= {
108
-
"netbox_script_manager Manager": {
109
-
"SCRIPT_ROOT": "/path/to/script/folder/",
110
-
"DEFAULT_QUEUE": "high"
111
-
},
112
-
}
113
-
```
114
127
115
-
## Configuration
128
+
## Git Sync
116
129
117
-
The following options are required:
130
+
> :grey_exclamation: git must be installed on the system
118
131
119
-
*`SCRIPT_ROOT`: Path to the script folder containing the customscripts module.
132
+
> :grey_exclamation: The netbox user must have the `sync` additional action for the `Script Instance` permission
120
133
121
-
The following options are optional:
134
+
> :warning: git recurses parent directories until finding a git directory. Make sure the `SCRIPT_ROOT` is a git directory.
122
135
123
-
*`DEFAULT_QUEUE`: Specifies what queue scripts are run in by default. Defaults to the `default` queue.
136
+
Netbox Script Manager has basic support for pulling down changes for git repositories. The Sync button is located on the script list and simply calls `git pull` on in the `SCRIPT_ROOT/customscripts` folder. If the git reposity requires authentication, it's recommended to setup SSH auth for the repo and provide the key in the users `$HOME/.ssh` folder.
124
137
138
+
If more advanced syncing is required, its recommended to handle this outside of netbox or alternatively use a custom script to do the sync.
0 commit comments