{"id":13710660,"url":"https://github.com/lae/ansible-role-netbox","last_synced_at":"2025-05-06T19:32:18.382Z","repository":{"id":41329885,"uuid":"81477843","full_name":"lae/ansible-role-netbox","owner":"lae","description":"Cross-platform Ansible role for deploying NetBox, a DCIM/IPAM tool, in a production environment.","archived":false,"fork":false,"pushed_at":"2024-11-29T03:23:15.000Z","size":509,"stargazers_count":202,"open_issues_count":14,"forks_count":72,"subscribers_count":15,"default_branch":"develop","last_synced_at":"2024-11-29T03:30:36.895Z","etag":null,"topics":["ansible","dcim","inventory-management","ipam","netbox"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lae.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"sleepingkyoto","custom":["https://monappy.jp/u/lae"]}},"created_at":"2017-02-09T17:48:55.000Z","updated_at":"2024-11-29T02:37:08.000Z","dependencies_parsed_at":"2023-02-17T19:01:11.887Z","dependency_job_id":"81dc7cfb-867e-43b0-b561-5570a8ce76d4","html_url":"https://github.com/lae/ansible-role-netbox","commit_stats":null,"previous_names":[],"tags_count":71,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lae%2Fansible-role-netbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lae%2Fansible-role-netbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lae%2Fansible-role-netbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lae%2Fansible-role-netbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lae","download_url":"https://codeload.github.com/lae/ansible-role-netbox/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252753657,"owners_count":21798988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","dcim","inventory-management","ipam","netbox"],"created_at":"2024-08-02T23:00:59.451Z","updated_at":"2025-05-06T19:32:13.350Z","avatar_url":"https://github.com/lae.png","language":"Python","funding_links":["https://ko-fi.com/sleepingkyoto","https://monappy.jp/u/lae"],"categories":["Ansible","Deployment"],"sub_categories":[],"readme":":role-author: lae\n:role-name: netbox\n:role: {role-author}.{role-name}\n:gh-name: {role-author}/ansible-role-{role-name}\n:netbox-version: 3.7.3\n= {role}\n:toc:\n:toc-placement: preamble\nifdef::env-github[]\n:tip-caption: :bulb:\n:warning-caption: :warning:\nendif::[]\n\nifdef::env-github[]\nimage:https://img.shields.io/badge/role-{role}-blue?style=for-the-badge[Ansible Galaxy Role,link=https://galaxy.ansible.com/{role-author}/{role-name}]\nendif::env-github[]\n\nDeploys and configures https://github.com/netbox-community/netbox[NetBox], an IP address management (IPAM) and data center infrastructure management (DCIM) tool.\n\nThis role will deploy NetBox within its own virtualenv either by release tarball or via git using uWSGI as the application server.\n\nSupports CentOS 7,8 / RHEL 9 / Debian 9,10,11,12 / Ubuntu 16, 18, 20 and 22.\n\nNote that this role is slightly opinionated and differs from installation instructions from the NetBox documentation.\nThe main differences are:\n\n* Uses distro-provided systemd instead of supervisord\n* Uses uWSGI as an application server instead of gunicorn\n* Hardens the NetBox/uWSGI service (see `templates/netbox.service.j2`)\n* Will hot reload on upgrades and configuration changes\n\n== Quickstart\n\nProvided you have Ansible installed and are using defaults:\n\n[source,bash,subs=\"attributes\"]\n----\nansible-galaxy install geerlingguy.postgresql davidwittman.redis {role}\nansible-galaxy collection install community.postgresql\nansible-playbook -i your.server.fqdn, ~/.ansible/roles/{role}/examples/playbook_single_host_deploy.yml -K\n----\n\nThis will deploy NetBox and PostgreSQL on `your.server.fqdn`; once complete it\nshould be accessible on port 80. Modify if needed. Read below for more insight.\n\nYou can also use Vagrant, if you prefer, to bring up NetBox at `localhost:8080`:\n\n[source,bash,subs=\"attributes\"]\n----\nansible-galaxy install geerlingguy.postgresql davidwittman.redis {role}\nansible-galaxy collection install community.postgresql\ncd ~/.ansible/roles/{role}/\nvagrant up\n----\n\n== Support/Contributing\n\nIf you would like to contribute to this role, please read `DEVELOPING.md` for\nthis repository's workflow and (optional) instructions on setting up a\ndevelopment environment. This role uses the `lae.travis-lxc` role when testing\nunder Travis CI, which you can find definitions for in the `tests/` directory.\n\nifeval::[\"{role-author}\" == \"lae\"]\nFor support or if you'd like to contribute to this role but want guidance, feel\nfree to ask in @lae's Discord server: https://discord.gg/cjqr6Fg\n\nendif::[]\n== Prerequisites\n\n=== PostgreSQL\n\nThis role does not setup a PostgreSQL server (but will create a database if needed), so you'll need to setup a PostgreSQL server and create a database user separate from this role.\nTake a look at the _Example Playbook_ section.\n\nIn addition, for Ansible 2.10+, you may need to install the `community.postgresql` collection.\nIt is recommended to specify this in your playbook's `requirements.yml` file.\nFor example:\n\n[source,yaml]\n----\n---\ncollections:\n  - name: community.postgresql\n    version: 3.4.0\n----\n\nWARNING: NetBox v2.2.0+ require PostgreSQL 9.4 at the minimum, which may not be available in your distribution's repos.\nYou may want to use a role for this.\n\n=== Redis\n\nThis role does not setup or manage a Redis instance. You may want to either\ninstall `redis-server` via a task in `pre_tasks` within your playbook or use a\nRedis installation role such as\nhttps://galaxy.ansible.com/davidwittman/redis[DavidWittman.redis].\n\nWARNING: NetBox v2.9.0+ require Redis 4.0 at the minimum. The role suggested\nabove defaults to a 2.8 version, so make sure you specify a newer version in a\nrole variable or deploy Redis 4.0+ another way.\n\n== Role Variables\n\nTIP: See `examples/` for some playbooks you could write for different scenarios.\n\nWARNING: A few role variables are mandatory. Look for the bold *required* below.\n\n[source,yaml]\n----\nnetbox_stable: false\nnetbox_git: false\n----\n\nIt's *required* to set one of the above variables to `true`. `netbox_stable`\ntells the role to deploy by extracting tarball releases from GitHub, while\n`netbox_git` tells the role to clone a NetBox git repository - they're mutually\nexclusive.\n\n[source,yaml,subs=\"attributes\"]\n----\nnetbox_stable_version: {netbox-version}\nnetbox_stable_uri: \"https://github.com/netbox-community/netbox/archive/v{{ netbox_stable_version }}.tar.gz\"\n----\n\nThese can be configured to pin a version (e.g. increment to trigger an upgrade)\nor deploy using a tarball located somewhere else. Useful for when you need to\nmodify something in a release or are deploying locally behind a firewall.\n\n[source,yaml]\n----\nnetbox_git_version: develop\nnetbox_git_uri: \"https://github.com/netbox-community/netbox.git\"\n----\n\n`netbox_git_version` can be any valid ref within a git repository.\n`netbox_git_uri` can be used to point to e.g. an on-premise repo or a fork.\n\n[source,yaml]\n----\nnetbox_superuser_enabled: true\nnetbox_superuser_username: admin\n#netbox_superuser_password: changeme\nnetbox_superuser_email: admin@localhost\nnetbox_superuser_create_token: false\n----\n\nThese variables are used to configure a local superuser account. Disable this\nif you do not want to create one (when using LDAP for example - though having a\nlocal superuser may still be beneficial in that case). When enabled, it is\n*required* to set the superuser password. This role will create a new superuser\nif the user does not exist, or will modify an existing user if they're not a\nsuperuser/have a different email or password. (Yes, you can use this to reset\nyour superuser password if you forget it.) `netbox_superuser_create_token` can\nbe used to generate a random API token for the superuser, if needed.\n\n[source,yaml]\n----\nnetbox_database: netbox\nnetbox_database_user: netbox\n#netbox_database_password: changeme\n#netbox_database_host: localhost\nnetbox_database_port: 5432\n#netbox_database_socket: /var/run/postgresql\n----\n\nIt is *required* to configure either a socket directory (to communicate over\nUNIX sockets) or a host/password (to use TCP/IP). See the _Example Playbook_\nsection for more information on configuring the database.\n\nNote that these are used to configure `DATABASE` in `configuration.py`.\n\n[source,yaml]\n----\nnetbox_database_conn_age: 300\n----\n\nTo configure Netbox to keep database connections open longer than a single requests,\nset `netbox_database_conn_age` to your preferred maximum connection age, in seconds.\n300 seconds (5 minutes) is typically a good number to start with.\n\n[source,yaml]\n----\nnetbox_database_maintenance: postgres\n----\n\nIf the postgres database is configured to only allow access to specific tables of the DB for the user configured with Netbox, you can set `netbox_database_maintenance` to replace the default database used for connection checking to a different table than the default `postgres`. This is an empty table in every postgres database by default, but some configurations might block access to this table, so a different table (i.e. `netbox_prod`) can be used here instead.\n\n[source,yaml]\n----\n# Example usage, default is empty dict\nnetbox_database_options:\n  sslmode: require\n  isolation_level: 3\n----\n\nIf you need to set any other PostgreSQL parameter key words you can do\nso here. For cases like https://docs.djangoproject.com/en/3.1/ref/databases/#isolation-level[isolation levels] the numerical value must be used\ninstead of the constant:\n`psycopg2.extensions.ISOLATION_LEVEL_SERIALIZABLE` vs `3`.\nOnly add things here if you really know what you're doing.\n\n[source,yaml]\n----\nnetbox_redis_host: 127.0.0.1\nnetbox_redis_port: 6379\nnetbox_redis_password: ''\nnetbox_redis_database: 0\nnetbox_redis_default_timeout: 300\nnetbox_redis_ssl_enabled: false\nnetbox_redis_insecure_skip_tls_verify: false\n\nnetbox_redis_cache_host: \"{{ netbox_redis_host }}\"\nnetbox_redis_cache_port: \"{{ netbox_redis_port }}\"\nnetbox_redis_cache_database: 1\nnetbox_redis_cache_password: \"{{ netbox_redis_password }}\"\nnetbox_redis_cache_default_timeout: \"{{ netbox_redis_default_timeout }}\"\nnetbox_redis_cache_ssl_enabled: \"{{ netbox_redis_ssl_enabled }}\"\nnetbox_redis_cache_insecure_skip_tls_verify: \"{{ netbox_redis_insecure_skip_tls_verify }}\"\n----\n\nThis populates the `REDIS` config dictionary in `configuration.py`. Use the\nsecond set of variables if you wish to split your cache database from your\nwebhooks database.\n\n[source,yaml]\n----\nnetbox_redis_sentinels:\n  - { host: '192.168.0.1', port: '5000' },\n  - { host: '192.168.0.2', port: '5000' }\nnetbox_redis_sentinel_service: 'netbox'\nnetbox_redis_password: ''\nnetbox_redis_database: 0\nnetbox_redis_default_timeout: 300\nnetbox_redis_ssl_enabled: false\n\nnetbox_redis_cache_sentinels: \"{{ netbox_redis_sentinels }}\"\nnetbox_redis_cache_sentinel_service: \"{{ netbox_redis_sentinel_service }}\"\nnetbox_redis_cache_database: 1\nnetbox_redis_cache_password: \"{{ netbox_redis_password }}\"\nnetbox_redis_cache_default_timeout: \"{{ netbox_redis_default_timeout }}\"\nnetbox_redis_cache_ssl_enabled: \"{{ netbox_redis_ssl_enabled }}\"\n----\n\nUse this syntax if your redis is installed with sentinet architecture (multiple nodes). Use\nthe second set of variables if you wish to split your cache database from your\nwebhooks database.\n\n[source,yaml]\n----\nnetbox_rqworker_processes: 1\n----\n\nSpecify how many request queue workers should be started by the systemd service.\nYou can leave this at the default of 1, unless you have a large number of reports,\nscripts and other background tasks.\n\n[source,yaml]\n----\nnetbox_config:\n  #SECRET_KEY:\n  ALLOWED_HOSTS:\n    - localhost\n    - 127.0.0.1\n  #NAPALM_USERNAME:\n  #NAPALM_PASSWORD:\n  MEDIA_ROOT: \"{{ netbox_shared_path }}/media\"\n  REPORTS_ROOT: \"{{ netbox_shared_path }}/reports\"\n  SCRIPTS_ROOT: \"{{ netbox_shared_path }}/scripts\"\n----\n\nThis is a dictionary of settings used to template NetBox's `configuration.py`.\nSee http://netbox.readthedocs.io/en/stable/configuration/mandatory-settings/[Mandatory Settings]\nand http://netbox.readthedocs.io/en/stable/configuration/optional-settings/[Optional Settings]\nfrom the NetBox documentation for more details, as well as\n`examples/netbox_config.yml` in this repository.\n\nIt is not necessary to define `SECRET_KEY` here - this role will automatically\ncreate one for you at `{{ netbox_shared_path }}/generated_secret_key`. The\n`SECRET_KEY` will then be read from this file on subsequent runs, unless you\nlater do set this in your playbook. Note that you should define the\n`SECRET_KEY` if you are deploying multiple NetBox instances behind one load\nbalancer.\n\nIf you have enabled NAPALM integration in this role, you will need to configure\nNAPALM credentials here as well.\n\n`MEDIA_ROOT`/`REPORTS_ROOT`/`SCRIPTS_ROOT`, while not mandatory in the NetBox\ndocumentation, is mandatory in this role to prevent losing these files during\nupgrades (this role does not upgrade NetBox in-place). It should be set to a\ndirectory that is permanent and not lost on upgrade (the default, listed above,\ncan be used without issue). This role will attempt to create these directories\nand change their ownership to whatever `netbox_user` is set to.\n\n[source,yaml]\n----\nnetbox_scripts: []\nnetbox_reports: []\n----\n\nhttps://netbox.readthedocs.io/en/stable/additional-features/custom-scripts/[Scripts]\nand https://netbox.readthedocs.io/en/stable/additional-features/reports/[Reports]\nto upload for use within NetBox. These should be lists of dictionaries with a\n`src` attribute, specifying the local path to the script or report, and a\n`name` attribute, specifying the module name (script/report name). For example:\n\n[source,yaml]\n----\n## Example\nnetbox_scripts:\n  - src: netbox_scripts/migrate_application.py\n    name: migrate_application\nnetbox_reports:\n  - src: netbox_reports/devices.py\n    name: devices\n----\n\nThis will copy `netbox_scripts/migrate_application.py` from your playbook\ndirectory to `{{ netbox_config.SCRIPTS_ROOT }}/migrate_application.py` and\n`netbox_reports/devices.py` to `{{ netbox.config.REPORTS_ROOT }}/devices.py`.\n\n[source,yaml]\n----\nnetbox_pip_packages: []\n\n## Example:\nnetbox_pip_packages:\n  - https://github.com/steffann/netbox-example-plugin.git\n  - netbox-topology-views\n----\n\nThis is a list of extra packages to install via `pip` within NetBox'\nvirtualenv. You can specify any valid artifact that `pip` understands.\n\nIf you list any plugins here, be sure to include the appropriate plugin\nconfigurations within the `netbox_config` role variable.  Read\nhttps://netbox.readthedocs.io/en/stable/plugins/[Plugins] for more info.\n\n[source,yaml]\n----\nnetbox_user: netbox\nnetbox_group: netbox\nnetbox_home: /srv/netbox\nnetbox_releases_path: \"{{ netbox_home }}/releases\"\nnetbox_git_repo_path: \"{{ netbox_releases_path }}/git-repo\"\nnetbox_git_deploy_path: \"{{ netbox_releases_path }}/git-deploy\"\nnetbox_stable_path: \"{{ netbox_releases_path }}/netbox-{{ netbox_stable_version }}\"\nnetbox_current_path: \"{{ netbox_home }}/current\"\nnetbox_shared_path: \"{{ netbox_home }}/shared\"\n----\n\nThese are all deployment details that you can modify to change the application\nuser and application storage locations. `netbox_releases_path` stores all\nNetBox releases you've ever deployed. `netbox_git_repo_path` is where the Git\nrepository will be cloned to and should remain untouched - whilst\n`netbox_git_deploy_path` is where a `git archive` using the ref\n`netbox_git_version` will be extracted to. `netbox_stable_path` is the\nextracted folder from a release tarball. `netbox_current_path` will be\nsymlinked to the selected release and used in service/configuration files as\nthe location NetBox is installed. `netbox_shared_path` is intended to store\nconfiguration files and other \"shared\" content, like logs.\n\n[source,yaml]\n----\nnetbox_socket: \"127.0.0.1:8000\"\nnetbox_protocol: http\nnetbox_processes: \"{{ ansible_processor_vcpus }}\"\n----\n\n`netbox_socket` defines what the uWSGI service will bind to and can be set to\nany valid https://www.freedesktop.org/software/systemd/man/systemd.socket.html#ListenStream=[ListenStream]\naddress (systemd socket). Set `netbox_protocol` to `uwsgi` if you want uWSGI to\nspeak WSGI (for instance if you're running nginx as a load balancer).\n`netbox_processes` defines how many NetBox workers uWSGI will bring up to serve\nrequests.\n\n[source,yaml]\n----\nnetbox_application_log: \"file:{{ netbox_shared_path }}/application.log\"\nnetbox_requests_log: \"file:{{ netbox_shared_path }}/requests.log\"\n----\n\nThese define where logs will be stored. You can use external logging facilities\ninstead of local files if you wish,\nhttp://uwsgi-docs.readthedocs.io/en/latest/Logging.html#pluggable-loggers[as\nlong as uWSGI supports it].  Application log correlates to `logger` and\nrequests log to `req-logger`.\n\n[source,yaml]\n----\nnetbox_ldap_enabled: false\nnetbox_ldap_config_template: netbox_ldap_config.py.j2\n----\n\nToggle `netbox_ldap_enabled` to `true` to configure LDAP authentication for\nNetBox. `netbox_ldap_config_template` should be the path to your template - by\ndefault, Ansible will search your playbook's `templates/` directory for this.\nYou can find an example in `examples/`. You will also need to set\n`netbox_config.REMOTE_AUTH_BACKEND` to `netbox.authentication.LDAPBackend`.\n\nTIP: By default, a local (non-LDAP) superuser will still be created by this\nrole. If this is undesirable, consider toggling `netbox_superuser_enabled`.\n\n[source,yaml]\n----\nnetbox_napalm_enabled: false\nnetbox_napalm_packages:\n  - napalm\n----\n\nToggle `netbox_napalm_enabled` to enable NAPALM integration in NetBox. You must\ndefine `NAPALM_USERNAME` and `NAPALM_PASSWORD` in the `netbox_config` variable\nto be able to use NAPALM. Add extra NAPALM python libraries by listing them in\n`netbox_napalm_packages` (e.g. `napalm-eos`).\n\n[source,yaml]\nnetbox_metrics_enabled: false\n\nToggle `netbox_metrics_enabled` to `true` to enable application metrics (via\nhttps://github.com/korfuri/django-prometheus[django-prometheus]). This adds\nrelevant pieces of configuration for proper metrics handling.\n(https://netbox.readthedocs.io/en/stable/additional-features/prometheus-metrics/[more\ninfo]).\n\n[source,yaml]\n----\nnetbox_metrics_dir: netbox_metrics\nnetbox_metrics_path: \"/run/{{ netbox_metrics_dir }}\"\n----\n\nThe directory name where the metrics files are stored can be set with\n`netbox_metrics_dir`. However, `netbox_metrics_path` must remain the default\n(seen above) in order to work with `systemd` and the `RuntimeDirectory`\nparameter (which only points to `/run`).\n\n[source,yaml]\nnetbox_keep_uwsgi_updated: false\n\nToggle `netbox_keep_uwsgi_updated` to `true` if you wish to ensure your uwsgi\nserver is the latest release, otherwise uwsgi will not be updated on subsequent\nruns of your playbook.\n\n[source,yaml]\nnetbox_uwsgi_options: {}\n\nSpecify extra configuration options to insert into `uwsgi.ini` here. This is\nexpected to be a dictionary of key/value pairs, e.g. `buffer-size: 65535`.\n\n[source,yaml]\nnetbox_uwsgi_in_venv: false\n\nToggle `netbox_uwsgi_in_venv` to `true` if you want `uwsgi` to be installed in the same virtual environment as NetBox.\nOtherwise, it will be installed system-wide into the library path of the python version used to created the virtual environment (normal/legacy behavior).\n\nWARNING: There's a possibility that this may become the default in a later version of this role (I think after further cross-platform testing).\nSee https://github.com/lae/ansible-role-netbox/issues/144[issue #144] for further details.\n\n[source,yaml]\nnetbox_install_epel: true\n\nToggle `netbox_install_epel` to `false` if you do not want this role to install\nthe Fedora EPEL for you. This can be useful for enterprise environments where\nthe system's repositories are managed/mirrored by the enterprise.\n\n[source,yaml]\n----\nnetbox_packages: []\nnetbox_python_packages: []\nnetbox_python_binary: /usr/bin/python{{ some version }}\nnetbox_ldap_packages: []\n----\n\nThese variables are dynamically generated based on the target distribution. You\ncan check the defaults for these underneath the `vars/` directory. You can use\nthese variables to target an unsupported operating system (although feel free\nto open a PR to add in support!) or to specify a custom Python interpreter\n(such as PyPy) to be used for deployment. Although, please note that support by\nthis role may be limited for alternative Python installations.\n\n== Example Playbook\n\nThe following installs PostgreSQL and creates a user with @geerlingguy's robust\nPostgres role, then proceeds to deploy and configure NetBox using a local unix\nsocket to talk to the Postgres server with the default netbox database user.\n\n[source,yaml,subs=\"attributes\"]\n----\n- hosts: netbox.idolactiviti.es\n  become: yes\n  roles:\n    - geerlingguy.postgresql\n    - davidwittman.redis\n    - {role}\n  vars:\n    netbox_stable: true\n    netbox_database_socket: \"{{ postgresql_unix_socket_directories[0] }}\"\n    netbox_superuser_password: netbox\n    netbox_socket: \"0.0.0.0:80\"\n    netbox_config:\n      ALLOWED_HOSTS:\n        - netbox.idolactiviti.es\n      MEDIA_ROOT: \"{{ netbox_shared_path }}/media\"\n      REPORTS_ROOT: \"{{ netbox_shared_path }}/reports\"\n      SCRIPTS_ROOT: \"{{ netbox_shared_path }}/scripts\"\n    postgresql_users:\n      - name: \"{{ netbox_database_user }}\"\n        role_attr_flags: CREATEDB,NOSUPERUSER\n    redis_bind: 127.0.0.1\n    redis_version: 6.0.9\n    redis_checksum: sha256:dc2bdcf81c620e9f09cfd12e85d3bc631c897b2db7a55218fd8a65eaa37f86dd\n----\n\nNote the `CREATEDB` attribute.\n\nAssuming you have a PG server already running with the user `netbox_prod_user`\ncreated, it owns a database called `netbox_prod`, and it allows the host you're\ninstalling NetBox on to authenticate with it over TCP:\n\n[source,yaml,subs=\"attributes\"]\n----\n- hosts: netbox.idolactiviti.es\n  become: yes\n  roles:\n    - davidwittman.redis\n    - {role}\n  vars:\n    netbox_stable: true\n    netbox_superuser_password: netbox\n    netbox_socket: \"0.0.0.0:80\"\n    netbox_config:\n      ALLOWED_HOSTS:\n        - \"{{ inventory_hostname }}\"\n      MEDIA_ROOT: \"{{ netbox_shared_path }}/media\"\n      REPORTS_ROOT: \"{{ netbox_shared_path }}/reports\"\n      SCRIPTS_ROOT: \"{{ netbox_shared_path }}/scripts\"\n    netbox_database_host: pg-netbox.idolactiviti.es\n    netbox_database_port: 15432\n    netbox_database: netbox_prod\n    netbox_database_user: netbox_prod_user\n    netbox_database_password: \"very_secure_password_for_prod\"\n    netbox_database_maintenance: netbox_prod\n    redis_bind: 127.0.0.1\n    redis_version: 6.0.9\n    redis_checksum: sha256:dc2bdcf81c620e9f09cfd12e85d3bc631c897b2db7a55218fd8a65eaa37f86dd\n----\n\nSee the `examples/` directory for more.\n\n== Troubleshooting\n\n=== uWSGI resetting TCP connections\nWhen `netbox_protocol` is set to `http`, uWSGI might exhibit strange behaviour\nand reset TCP connections seemingly at random. This can manifest in a\n\"connection reset by peer\" error, for example when working with the API using\nhttps://github.com/netbox-community/pynetbox[pynetbox]. If you are affected by\nthis, try switching `netbox_protocol` to `uwsgi` and using a loadbalancer, or\nadjusting your `netbox_uwsgi_options` as follows. See https://github.com/lae/ansible-role-netbox/issues/130#issuecomment-847571006[this GitHub issue]\nfor a related discussion\n[source,yaml,subs=\"attributes\"]\n----\nnetbox_uwsgi_options:\n  http-keepalive: \"true\"\n  http-auto-chunked: \"true\"\n  add-header: \"Connection: Close\"\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flae%2Fansible-role-netbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flae%2Fansible-role-netbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flae%2Fansible-role-netbox/lists"}