Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simple Deploy- and Management
package.dhcp.kea
Commits
14364c01
Commit
14364c01
authored
Apr 26, 2019
by
Pietsch, Martin
Browse files
transform backend template to macro
parent
dac8b4dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
templates/kea-dhcp-backends.j2
View file @
14364c01
{% if dhcp_backend == "memfile" %}
{% macro backends(ipversion="ipv4") %}
{% if dhcp_backend == "memfile" %}
"lease-database": {
"type": "memfile",
{% if ipversion == "ipv4" %}
"name": "/var/db/kea/kea-leases4"
{% else %}
"name": "/var/db/kea/kea-leases6"
{% endif %}
},
{% elif dhcp_backend == "cassandra" %}
{%
elif dhcp_backend == "cassandra" %}
"lease-database": {
"type": "cql",
"keyspace": "{{ dhcp_db_dbname }}"
"contact-points": "{{ dhcp_db_host }}"
{% if dhcp_db_port is defined %}
{%
if dhcp_db_port is defined %}
"port": "{{ dhcp_db_port }}"
{% endif %}
{%
endif %}
},
{% else %}
{%
else %}
"lease-database": {
"type": "{{ dhcp_backend }}",
"name": "{{ dhcp_db_dbname }}",
"host": "{{ dhcp_db_host }}",
{% if dhcp_db_port is defined %}
{%
if dhcp_db_port is defined %}
"port": "{{ dhcp_db_port }}"
{% endif %}
{%
endif %}
"user": "{{ dhcp_db_user }}"
"password": "{{ dhcp_db_password | default("") }}"
},
...
...
@@ -28,10 +33,11 @@
"type": "{{ dhcp_backend }}",
"name": "{{ dhcp_db_dbname }}",
"host": "{{ dhcp_db_host }}",
{% if dhcp_db_port is defined %}
{%
if dhcp_db_port is defined %}
"port": "{{ dhcp_db_port }}"
{% endif %}
{%
endif %}
"user": "{{ dhcp_db_user }}"
"password": "{{ dhcp_db_password | default("") }}"
},
{% endif %}
{% endif %}
{% endmacro %}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment