ansible-ffibk/roles/pdns-admin/templates/config.py.j2
Tobias Hachmer 869dd5b62a
Migrate internal DNS master to PowerDNS
* Add playbook dns to manage internal dns master servers
 * Add role to manage PowerDNS Admin Web Frontend for PowerDNS
 * Move dns zone related data from mesh list to a simpler dict with a simple zone list
 * Update role service-bind-slave
 * Update Readme.md
 * Add requirements.yml
 * Update .gitignore
2019-03-20 19:43:11 +01:00

52 lines
1.5 KiB
Django/Jinja

import os
basedir = os.path.abspath(os.path.dirname(__file__))
{% if pdns_admin_global_config is defined %}
{% for key, value in pdns_admin_global_config.items() %}
{% if key | upper not in ["UPLOAD_DIR"] %}
{% if value is not mapping %}
{% if value is sequence and value is not string %}
{% if value[0] is number %}
{{ key | upper }} = [ {{ value|join(', ') }} ]
{% else %}
{{ key | upper }} = [ "{{ value|join('", "') }}" ]
{% endif %}
{% else %}
{% if value == "true" or value == "false" or value is number %}
{{ key | upper }} = {{ value }}
{% else %}
{{ key | upper }} = "{{ value }}"
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
# Upload
UPLOAD_DIR = os.path.join(basedir, 'upload')
{% endif %}
{% if pdns_admin_database_config is defined %}
{% for key, value in pdns_admin_database_config.items() %}
{% if key | upper not in ["SQLALCHEMY_DATABASE_URI", "SQLALCHEMY_MIGRATE_REPO"] %}
{% if value is not mapping %}
{% if value is sequence and value is not string %}
{% if value[0] is number %}
{{ key | upper }} = [ {{ value|join(', ') }} ]
{% else %}
{{ key | upper }} = [ "{{ value|join('", "') }}" ]
{% endif %}
{% else %}
{% if value == "true" or value == "false" or value is number %}
{{ key | upper }} = {{ value }}
{% else %}
{{ key | upper }} = "{{ value }}"
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
SQLALCHEMY_DATABASE_URI = 'mysql://'+SQLA_DB_USER+':'\
+SQLA_DB_PASSWORD+'@'+SQLA_DB_HOST+'/'+SQLA_DB_NAME
{% endif %}
SAML_ENABLED = False