Skip to content

Commit

Permalink
Merge pull request #61 from jvoss/netbox-v.3.4.9
Browse files Browse the repository at this point in the history
version bump and configuration updates for netbox v3.4.9
  • Loading branch information
jvoss authored Apr 26, 2023
2 parents 123850d + 619b2e8 commit 437ab15
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/netbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- ubuntu2004
- ubuntu2204
netbox:
- v3.4.8
- v3.4.9
- v3.3.10
- v3.2.9
- v3.1.11
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Ansible Role: Netbox

[![Netbox](
https://img.shields.io/badge/Netbox-v3.4.8-blue)](https://github.com/netbox-community/netbox)
https://img.shields.io/badge/Netbox-v3.4.9-blue)](https://github.com/netbox-community/netbox)
[![CI](https://github.com/jvoss/ansible-role-netbox/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jvoss/ansible-role-netbox/actions/workflows/ci.yml)
[![Netbox](https://github.com/jvoss/ansible-role-netbox/actions/workflows/netbox.yml/badge.svg)](https://github.com/jvoss/ansible-role-netbox/actions/workflows/netbox.yml)
[![Ansible Galaxy](https://img.shields.io/badge/galaxy-jvoss.netbox-blue.svg)](https://galaxy.ansible.com/jvoss/netbox)
Expand Down
15 changes: 15 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ netbox_cors_origin_regex_whitelist: [
# "r'^https?://)?(\w+\.)?example\.com$'"
]

# Netbox >= 3.4.9
# https://github.com/netbox-community/netbox/issues/11386
# set django config element CSRF_COOKIE_SECURE
# netbox_csrf_cookie_secure: True

# Netbox >3.2
# https://github.com/netbox-community/netbox/issues/8509
netbox_csrf_trusted_origins: []
Expand Down Expand Up @@ -382,12 +387,22 @@ netbox_rq_default_timeout: 300
# The name to use for the session cookie.
netbox_session_cookie_name: 'sessionid'

# Netbox >= 3.4.9
# https://github.com/netbox-community/netbox/issues/11386
# set django config element SESSION_COOKIE_SECURE
# netbox_session_cookie_secure: True

# By default, NetBox will store session data in the database. Alternatively, a file
# path can be specified here to use local file storage instead. (This can be useful for
# enabling authentication on a standby instance with read-only database access.) Note
# that the user as which NetBox runs must have read and write permissions to this path.
netbox_session_file_path: None

# Netbox >= 3.4.9
# https://github.com/netbox-community/netbox/issues/11386
# set django config element SECURE_SSL_REDIRECT
# netbox_secure_ssl_redirect: True

# Time zone (default: UTC)
netbox_time_zone: UTC

Expand Down
12 changes: 12 additions & 0 deletions templates/configuration.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ CORS_ORIGIN_REGEX_WHITELIST = {{ netbox_cors_origin_regex_whitelist|to_json }}
CORS_ORIGIN_REGEX_WHITELIST = []
{% endif %}

{% if netbox_csrf_cookie_secure is defined %}
CSRF_COOKIE_SECURE = {{ netbox_csrf_cookie_secure | to_json }}
{% endif %}

{% if netbox_csrf_trusted_origins | length > 0 %}
CSRF_TRUSTED_ORIGINS = {{ netbox_csrf_trusted_origins }}
{% endif %}
Expand Down Expand Up @@ -314,8 +318,16 @@ FILE_UPLOAD_MAX_MEMORY_SIZE = {{ netbox_file_upload_max_memory_size }}
CSRF_COOKIE_NAME = '{{ netbox_csrf_cookie_name }}'
{% endif %}

{% if netbox_secure_ssl_redirect is defined %}
SECURE_SSL_REDIRECT = {{ netbox_secure_ssl_redirect | to_json }}
{% endif %}

SESSION_COOKIE_NAME = '{{ netbox_session_cookie_name }}'

{% if netbox_session_cookie_secure is defined %}
SESSION_COOKIE_SECURE = {{ netbox_session_cookie_secure | to_json }}
{% endif %}

{% if netbox_session_file_path == 'None' %}
SESSION_FILE_PATH = None
{% else %}
Expand Down

0 comments on commit 437ab15

Please sign in to comment.