From bdf66ab41f8b19f0cbefb95fabc277f3bbd04716 Mon Sep 17 00:00:00 2001 From: Steve Milner Date: Fri, 5 May 2017 14:26:16 -0400 Subject: Use local variables for daemon.json template Instead of using bare lists and dicts this change converts variables into json for use with daemon.json. jinja2 does have an ability to do this in side of templates, however it is only available in 2.9+. Until then the use of ansible's to_json in the playbook is being used. Refs: - http://jinja.pocoo.org/docs/2.9/templates/#tojson - http://docs.ansible.com/ansible/playbooks_filters.html#filters-for-formatting-data --- roles/docker/templates/daemon.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'roles/docker/templates') diff --git a/roles/docker/templates/daemon.json b/roles/docker/templates/daemon.json index 30a1b30f4..7ea8164b3 100644 --- a/roles/docker/templates/daemon.json +++ b/roles/docker/templates/daemon.json @@ -12,7 +12,7 @@ "default-gateway": "", "default-gateway-v6": "", "default-runtime": "oci", - "containerd": "/var/run/containerd.sock", + "containerd": "/run/containerd.sock", "default-ulimits": {}, "disable-legacy-registry": false, "dns": [], @@ -26,7 +26,7 @@ "group": "", "hosts": [], "icc": false, - "insecure-registries": {{ docker_insecure_registries|default([]) }}, + "insecure-registries": {{ l_docker_insecure_registries }}, "ip": "0.0.0.0", "iptables": false, "ipv6": false, @@ -36,9 +36,9 @@ "live-restore": true, {% if docker_log_driver is defined %} "log-driver": "{{ docker_log_driver }}", -{% endif %} +{%- endif %} "log-level": "", - "log-opts": {{ docker_log_options|default({}) }}, + "log-opts": {{ l_docker_log_options }}, "max-concurrent-downloads": 3, "max-concurrent-uploads": 5, "mtu": 0, @@ -60,7 +60,7 @@ "tlskey": "", "tlsverify": true, "userns-remap": "", - "add-registry": {{ docker_additional_registries|default([]) }}, - "blocked-registries": {{ docker_blocked_registries|default([]) }}, + "add-registry": {{ l_docker_additional_registries }}, + "blocked-registries": {{ l_docker_blocked_registries }}, "userland-proxy-path": "/usr/libexec/docker/docker-proxy-current" } -- cgit v1.2.3