Skip to content

Commit 321e287

Browse files
committed
Update README, add comment to templates
1 parent 61f703c commit 321e287

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
lae.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

913
Requirements
1014
------------
@@ -38,13 +42,21 @@ See the *Example Playbook* section for more information on configuring the DB.
3842
default) stored in `/srv/netbox/shared/generated_secret_key`. This will then be
3943
used 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

4547
To load the initial data shipped by NetBox, set `netbox_load_initial_data` to
4648
true. 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

4961
Example 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

templates/configuration.py.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# {{ ansible_managed }}
12
ALLOWED_HOSTS = {{ netbox_allowed_hosts | to_json }}
23
DATABASE = {
34
'NAME': '{{ netbox_database }}',

templates/netbox.service.j2

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
# {{ ansible_managed }}
12
[Unit]
2-
Description=NetBox datacenter management application using uWSGI
3+
Description=NetBox IPAM/DCIM tool
34
Documentation=http://netbox.readthedocs.io/en/{{ 'latest' if netbox_git else 'stable' }}/
45
After=syslog.target
56

0 commit comments

Comments
 (0)