Skip to content

Commit

Permalink
Generalize netbox_plugins to netbox_pip_packages
Browse files Browse the repository at this point in the history
Fixes #92
  • Loading branch information
lae committed May 2, 2020
1 parent 3191deb commit ebcf10e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
14 changes: 8 additions & 6 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,20 @@ directory to `{{ netbox_config.SCRIPTS_ROOT }}/migrate_application.py` and

[source,yaml]
----
netbox_plugins: []
netbox_pip_packages: []
## Example:
netbox_plugins:
netbox_pip_packages:
- https://github.com/steffann/netbox-example-plugin.git
- netbox-topology-views
----

This is a list of plugins to install via `pip` within NetBox' virtualenv. You
can specify any valid artifact that `pip` understands to install a plugin. Be
sure to include plugin configurations within the `netbox_config` role variable.
Read https://netbox.readthedocs.io/en/stable/plugins/[Plugins] for more info.
This is a list of extra packages to install via `pip` within NetBox'
virtualenv. You can specify any valid artifact that `pip` understands.

If you list any plugins here, be sure to include the appropriate plugin
configurations within the `netbox_config` role variable. Read
https://netbox.readthedocs.io/en/stable/plugins/[Plugins] for more info.

[source,yaml]
----
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ netbox_config:

netbox_scripts: []
netbox_reports: []
netbox_plugins: []

netbox_user: netbox
netbox_group: netbox
Expand All @@ -80,6 +79,7 @@ netbox_napalm_enabled: false
netbox_napalm_packages:
- napalm

netbox_pip_packages: []
netbox_pip_constraints:
# Blacklist pynacl 1.3.0 due to https://github.com/pyca/pynacl/issues/479
- 'pynacl!=1.3.0'
Expand Down
4 changes: 2 additions & 2 deletions tasks/load_variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- "{{ 'django-auth-ldap' if netbox_ldap_enabled else [] }}"
- "{{ 'django-storages' if _netbox_storages_module is defined else [] }}"
- "{{ _netbox_storages_map[_netbox_storages_module] if _netbox_storages_module is defined else [] }}"
- "{{ netbox_plugins }}"
- "{{ netbox_pip_packages }}"

- name: Flatten that list of dependencies
set_fact:
Expand All @@ -54,4 +54,4 @@
- name: Capture Default Python Interpreter
set_fact:
_netbox_global_python: "{{ ansible_python_interpreter }}"
when: ansible_python_interpreter is defined
when: ansible_python_interpreter is defined
4 changes: 4 additions & 0 deletions tests/group_vars/netbox
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
netbox_socket: "0.0.0.0:8080"
netbox_pip_packages:
- netbox-topology-views
netbox_config:
ALLOWED_HOSTS:
- "{{ inventory_hostname }}"
Expand All @@ -11,6 +13,8 @@ netbox_config:
NAPALM_ARGS:
use_keys: true
key_file: '/srv/netbox/.ssh/id_rsa'
PLUGINS:
- netbox_topology_views
netbox_scripts:
- src: scripts/nothing.py
name: nothing
Expand Down

0 comments on commit ebcf10e

Please sign in to comment.