44lae.netbox
55=========
66
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.
812
913Requirements
1014------------
@@ -38,13 +42,21 @@ See the *Example Playbook* section for more information on configuring the DB.
3842default) stored in ` /srv/netbox/shared/generated_secret_key ` . This will then be
3943used by the role to configure NetBox unless ` netbox_secret_key ` is later defined.
4044
41- ` netbox_bind_address ` is the address Gunicorn will be configured to listen on.
42-
4345` netbox_allowed_hosts ` is a list defining ` ALLOWED_HOSTS ` .
4446
4547To load the initial data shipped by NetBox, set ` netbox_load_initial_data ` to
4648true. Otherwise, this role will deploy NetBox with an empty slate.
4749
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+
4860
4961Example Playbook
5062----------------
@@ -61,6 +73,7 @@ socket to authenticate with the Postgres server.
6173 vars:
6274 netbox_stable: true
6375 netbox_database_socket: "{{ postgresql_unix_socket_directories[0] }}"
76+ netbox_uwsgi_socket: "0.0.0.0:80"
6477 netbox_allowed_hosts:
6578 - netbox.idolactiviti.es
6679 postgresql_users:
@@ -77,8 +90,9 @@ installing NetBox on to authenticate with it over TCP:
7790 - lae.netbox
7891 vars:
7992 netbox_stable: true
93+ netbox_uwsgi_socket: "0.0.0.0:80"
8094 netbox_allowed_hosts:
81- - netbox.idolactiviti.es
95+ - "{{ inventory_hostname }}"
8296 netbox_database_host: pg-netbox.idolactiviti.es
8397 netbox_database_port: 15432
8498 netbox_database_name: netbox_prod
0 commit comments