@@ -22,18 +22,25 @@ DATABASE = {
22
22
'HOST' : '{{ netbox_database_host }}' ,
23
23
'PORT' : '{{ netbox_database_port }}' ,
24
24
{% else % }
25
- { % if netbox_database_password is defined % }
25
+ { % if netbox_database_password is defined % }
26
26
'PASSWORD' : '{{ netbox_database_password }}' ,
27
- { % endif % }
27
+ { % endif % }
28
28
'HOST' : '{{ netbox_database_socket }}' ,
29
29
{% endif % }
30
30
'CONN_MAX_AGE' : {{ netbox_database_conn_age }},
31
31
}
32
32
33
+ {% if netbox_stable and netbox_stable_version is version ('2.9.4' , '>=' ) or
34
+ netbox_git and _netbox_git_contains_rq_timeout .rc == 0 % }
35
+ {% set _default_timeout = "RQ_DEFAULT_TIMEOUT" % }
36
+ {% else % }
37
+ {% set _default_timeout = "DEFAULT_TIMEOUT" % }
38
+ {% endif % }
39
+
33
40
REDIS = {
34
41
{# https://github.com/netbox-community/netbox/pull/4366 #}
35
42
{% if netbox_stable and netbox_stable_version is version ('2.7.11' , '>=' ) or
36
- netbox_git and _netbox_git_contains_tasks_rename % }
43
+ netbox_git and _netbox_git_contains_tasks_rename . rc == 0 % }
37
44
'tasks' : {
38
45
{% else % }
39
46
'webhooks' : {
@@ -42,15 +49,15 @@ REDIS = {
42
49
'PORT' : {{ netbox_redis_port }},
43
50
'PASSWORD' : '{{ netbox_redis_password }}' ,
44
51
'DATABASE' : {{ netbox_redis_database }},
45
- 'DEFAULT_TIMEOUT ' : {{ netbox_redis_default_timeout }},
52
+ '{{ _default_timeout }} ' : {{ netbox_redis_default_timeout }},
46
53
'SSL' : {{ netbox_redis_ssl_enabled }},
47
54
},
48
55
'caching' : {
49
56
'HOST' : '{{ netbox_redis_cache_host }}' ,
50
57
'PORT' : {{ netbox_redis_cache_port }},
51
58
'PASSWORD' : '{{ netbox_redis_cache_password }}' ,
52
59
'DATABASE' : {{ netbox_redis_cache_database }},
53
- 'DEFAULT_TIMEOUT ' : {{ netbox_redis_cache_default_timeout }},
60
+ '{{ _default_timeout }} ' : {{ netbox_redis_default_timeout }},
54
61
'SSL' : {{ netbox_redis_cache_ssl_enabled }},
55
62
}
56
63
}
@@ -60,13 +67,13 @@ METRICS_ENABLED = True
60
67
{% endif % }
61
68
62
69
{% for setting , value in _netbox_config .items () % }
63
- {% if value in [True , False ] % }
70
+ {% if value in [True , False ] % }
64
71
{{ setting }} = {{ 'True' if value else 'False' }}
65
- {% elif value is string or value is number % }
72
+ {% elif value is string or value is number % }
66
73
{{ setting }} = {{ value | to_nice_json }}
67
- {% else % }
74
+ {% else % }
68
75
{{ setting }} = json .loads (r'''{{ value | to_json }}''' )
69
- {% endif % }
76
+ {% endif % }
70
77
{% endfor % }
71
78
72
79
# vim: ft=python
0 commit comments