We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88ab1b0 commit 6d7a833Copy full SHA for 6d7a833
templates/configuration.py.j2
@@ -2,6 +2,8 @@
2
{# # Copyright (c) 2017-2020 Guillaume Mazoyer under the GPL #}
3
# {{ ansible_managed }}
4
5
+import json
6
+
7
DATABASE = {
8
'NAME': '{{ netbox_database }}',
9
'USER': '{{ netbox_database_user }}',
@@ -33,7 +35,9 @@ REMOTE_AUTH_BACKEND = 'netbox.authentication.LDAPBackend'
33
35
{% for setting, value in netbox_config.items() %}
34
36
{% if value in [True, False] %}
37
{{ setting }} = {{ 'True' if value else 'False' }}
-{% else %}
38
+{% elif value is number or value is string %}
39
{{ setting }} = {{ value | to_nice_json }}
40
+{% else %}
41
+{{ setting }} = json.loads(r"""{{ value | to_json }}""")
42
{% endif %}
43
{% endfor %}
0 commit comments