44lae.netbox
55=========
66
7- Installs and configures DigitalOcean's [ NetBox] ( https://github.com/digitalocean/netbox ) .
7+ Installs and configures DigitalOcean's [ NetBox] ( ) .
88
99This role deploys NetBox inside of a virtualenv, uses uWSGI as its frontend
1010(can be used standalone or behind a load balancer), works with both Python 2/3
@@ -38,11 +38,15 @@ order to use Python 2.
3838
3939See the * Example Playbook* section for more information on configuring the DB.
4040
41- ` netbox_secret_key ` , if left undefined, will be generated by this role and (by
42- default) stored in ` /srv/netbox/shared/generated_secret_key ` . This will then be
43- used by the role to configure NetBox unless ` netbox_secret_key ` is later defined.
41+ ` netbox_config ` should contain a dictionary of of settings to configure
42+ NetBox with. See [ Mandatory Settings] ( ) and [ Optional Settings] ( ) from the
43+ NetBox documentation for more information, as well as ` examples/netbox_config.yml `
44+ in this repository.
4445
45- ` netbox_allowed_hosts ` is a list defining ` ALLOWED_HOSTS ` .
46+ If ` netbox_config.SECRET_KEY ` is left undefined, this role will automatically
47+ generate one for you and store it in ` /srv/netbox/shared/generated_secret_key `
48+ (by default). The SECRET_KEY will be read from this file on subsequent runs,
49+ unless you override it by defining ` netbox_config.SECRET_KEY ` .
4650
4751To load the initial data shipped by NetBox, set ` netbox_load_initial_data ` to
4852true. Otherwise, this role will deploy NetBox with an empty slate.
@@ -79,8 +83,9 @@ socket to authenticate with the Postgres server.
7983 netbox_stable: true
8084 netbox_database_socket: "{{ postgresql_unix_socket_directories[0] }}"
8185 netbox_uwsgi_socket: "0.0.0.0:80"
82- netbox_allowed_hosts:
83- - netbox.idolactiviti.es
86+ netbox_config:
87+ ALLOWED_HOSTS:
88+ - netbox.idolactiviti.es
8489 postgresql_users:
8590 - name: "{{ netbox_database_user }}"
8691 role_attr_flags: CREATEDB,NOSUPERUSER
@@ -96,11 +101,15 @@ installing NetBox on to authenticate with it over TCP:
96101 vars:
97102 netbox_stable: true
98103 netbox_uwsgi_socket: "0.0.0.0:80"
99- netbox_allowed_hosts:
100- - "{{ inventory_hostname }}"
104+ netbox_config:
105+ ALLOWED_HOSTS:
106+ - "{{ inventory_hostname }}"
101107 netbox_database_host: pg-netbox.idolactiviti.es
102108 netbox_database_port: 15432
103109 netbox_database_name: netbox_prod
104110 netbox_database_user: netbox_prod_user
105111 netbox_database_password: "very_secure_password_for_prod"
106112
113+ [ NetBox ] : https://github.com/digitalocean/netbox
114+ [ Mandatory Settings ] : http://netbox.readthedocs.io/en/stable/configuration/mandatory-settings/
115+ [ Optional Settings ] : http://netbox.readthedocs.io/en/stable/configuration/optional-settings/
0 commit comments