4
4
lae.netbox
5
5
=========
6
6
7
- Installs and configures DigitalOcean's NetBox.
7
+ Installs and configures DigitalOcean's [ NetBox] ( https://github.com/digitalocean/netbox ) .
8
+
9
+ This role deploys NetBox inside of a virtualenv, uses uWSGI as its frontend
10
+ (can be used standalone or behind a load balancer), works with both Python 2/3
11
+ and has been tested across CentOS 7/Debian 8/Ubuntu 16.
8
12
9
13
Requirements
10
14
------------
@@ -38,13 +42,21 @@ See the *Example Playbook* section for more information on configuring the DB.
38
42
default) stored in ` /srv/netbox/shared/generated_secret_key ` . This will then be
39
43
used by the role to configure NetBox unless ` netbox_secret_key ` is later defined.
40
44
41
- ` netbox_bind_address ` is the address Gunicorn will be configured to listen on.
42
-
43
45
` netbox_allowed_hosts ` is a list defining ` ALLOWED_HOSTS ` .
44
46
45
47
To load the initial data shipped by NetBox, set ` netbox_load_initial_data ` to
46
48
true. Otherwise, this role will deploy NetBox with an empty slate.
47
49
50
+ Configure ` netbox_uwsgi_socket ` to either be a TCP address or UNIX socket to
51
+ bind to. By default, this role will configure uWSGI to serve a full uWSGI HTTP
52
+ web server. You can set ` netbox_behind_load_balancer ` to ` true ` to use an uWSGI
53
+ socket (and you can also set ` netbox_uwsgi_protocol ` to ` http ` to configure
54
+ uWSGI to use an HTTP-speaking socket instead).
55
+
56
+ By default, NetBox will be configured to output to ` /srv/netbox/shared/application.log `
57
+ and ` /srv/netbox/shared/requests.log ` . You can override these with a valid
58
+ uWSGI logger by setting ` netbox_uwsgi_logger ` and ` netbox_uwsgi_req_logger ` .
59
+
48
60
49
61
Example Playbook
50
62
----------------
@@ -61,6 +73,7 @@ socket to authenticate with the Postgres server.
61
73
vars:
62
74
netbox_stable: true
63
75
netbox_database_socket: "{{ postgresql_unix_socket_directories[0] }}"
76
+ netbox_uwsgi_socket: "0.0.0.0:80"
64
77
netbox_allowed_hosts:
65
78
- netbox.idolactiviti.es
66
79
postgresql_users:
@@ -77,8 +90,9 @@ installing NetBox on to authenticate with it over TCP:
77
90
- lae.netbox
78
91
vars:
79
92
netbox_stable: true
93
+ netbox_uwsgi_socket: "0.0.0.0:80"
80
94
netbox_allowed_hosts:
81
- - netbox.idolactiviti.es
95
+ - "{{ inventory_hostname }}"
82
96
netbox_database_host: pg-netbox.idolactiviti.es
83
97
netbox_database_port: 15432
84
98
netbox_database_name: netbox_prod
0 commit comments