Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
74 lines (73 sloc) 3.42 KB
{# docker daemon options for systemd managed systems #}
{% set docker__tpl_options = {} %}
{% if docker__bridge|d() -%}
{% set _ = docker__tpl_options.update({"bridge": docker__bridge}) %}
{%- endif %}
{% if docker__live_restore|d() and docker__register_version.stdout | version_compare('1.12', '>=') -%}
{% set lv_value = true if docker__live_restore else false %}
{% set _ = docker__tpl_options.update({"live-restore": lv_value}) %}
{%- endif %}
{% if docker__graph|d() -%}
{% set _ = docker__tpl_options.update({"graph": docker__graph}) %}
{%- endif %}
{% if docker__fixed_cidr|d() -%}
{% set _ = docker__tpl_options.update({"fixed-cidr": docker__fixed_cidr}) %}
{%- endif %}
{% if docker__dns_nameserver|d() -%}
{% set docker__tpl_dns_nameservers = [] %}
{% for element in docker__dns_nameserver -%}
{% set _ = docker__tpl_dns_nameservers.append(element) %}
{%- endfor %}
{% set _ = docker__tpl_options.update({"dns": docker__tpl_dns_nameservers}) %}
{%- endif %}
{% if docker__dns_search|d() -%}
{% set docker__tpl_dns_search = [] %}
{% for element in docker__dns_search -%}
{% set _ = docker__tpl_dns_search.append(element) %}
{%- endfor %}
{% set _ = docker__tpl_options.update({"dns-search": docker__tpl_dns_search}) %}
{%- endif %}
{% if docker__listen|d() and docker__register_version.stdout | version_compare('1.10', '>=') -%}
{% set docker__tpl_listen = [] %}
{% for element in docker__listen -%}
{% set _ = docker__tpl_listen.append(element) %}
{%- endfor %}
{% set _ = docker__tpl_options.update({"hosts": docker__tpl_listen}) %}
{%- endif %}
{% if docker__pki|d() | bool -%}
{% set _ = docker__tpl_options.update({"tlsverify": true}) %}
{% set _ = docker__tpl_options.update({"tlscacert": (docker__pki_path + "/" + docker__pki_realm + "/" + docker__pki_ca)}) %}
{% set _ = docker__tpl_options.update({"tlscert": (docker__pki_path + "/" + docker__pki_realm + "/" + docker__pki_crt)}) %}
{% set _ = docker__tpl_options.update({"tlskey": (docker__pki_path + "/" + docker__pki_realm + "/" + docker__pki_key)}) %}
{%- endif %}
{% if docker__debug|d() -%}
{% set _ = docker__tpl_options.update({"debug": docker__debug}) %}
{%- endif %}
{% if docker__registry_mirrors|d() -%}
{% set docker__tpl_registry_mirrors = [] %}
{% for element in docker__registry_mirrors -%}
{% set _ = docker__tpl_registry_mirrors.append(element) %}
{%- endfor %}
{% set _ = docker__tpl_options.update({"registry-mirrors": docker__tpl_registry_mirrors}) %}
{%- endif %}
{% if docker__labels|d() -%}
{% set docker__tpl_labels = [] %}
{% for key, value in docker__labels.iteritems() -%}
{% set _ = docker__tpl_labels.append(key+"="+value) %}
{%- endfor %}
{% set _ = docker__tpl_options.update({"labels": docker__tpl_labels}) %}
{%- endif %}
{% if docker__storage_driver|d() -%}
{% set _ = docker__tpl_options.update({"storage-driver": docker__storage_driver}) %}
{%- endif %}
{% if docker__storage_options|d() -%}
{% set docker__tpl_storage_options = [] %}
{% for key, value in docker__storage_options.iteritems() -%}
{% set _ = docker__tpl_storage_options.append(key+"="+value) %}
{%- endfor %}
{% set _ = docker__tpl_options.update({"storage-opts": docker__tpl_storage_options}) %}
{%- endif %}
{% if docker__custom_daemon_options|d() -%}
{% set _ = docker__tpl_options.update(docker__custom_daemon_options) %}
{%- endif %}
{{ docker__tpl_options | to_nice_json }}