diff options
author | Steve Milner <smilner@redhat.com> | 2017-05-05 14:26:16 -0400 |
---|---|---|
committer | Steve Milner <smilner@redhat.com> | 2017-05-08 14:21:15 -0400 |
commit | bdf66ab41f8b19f0cbefb95fabc277f3bbd04716 (patch) | |
tree | 06b79850b1cda83084e0dd3a569f3968bc07950d /roles/docker/tasks | |
parent | bc5eb65f9bcd4147130e062ef2e4499145811c90 (diff) | |
download | openshift-bdf66ab41f8b19f0cbefb95fabc277f3bbd04716.tar.gz openshift-bdf66ab41f8b19f0cbefb95fabc277f3bbd04716.tar.bz2 openshift-bdf66ab41f8b19f0cbefb95fabc277f3bbd04716.tar.xz openshift-bdf66ab41f8b19f0cbefb95fabc277f3bbd04716.zip |
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
Diffstat (limited to 'roles/docker/tasks')
-rw-r--r-- | roles/docker/tasks/systemcontainer_docker.yml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/roles/docker/tasks/systemcontainer_docker.yml b/roles/docker/tasks/systemcontainer_docker.yml index b0d0632b0..722232a9b 100644 --- a/roles/docker/tasks/systemcontainer_docker.yml +++ b/roles/docker/tasks/systemcontainer_docker.yml @@ -114,6 +114,14 @@ dest: "{{ docker_systemd_dir }}/custom.conf" src: systemcontainercustom.conf.j2 +# Set local versions of facts that must be in json format for daemon.json +# NOTE: When jinja2.9+ is used the daemon.json file can move to using tojson +- set_fact: + l_docker_insecure_registries: "{{ docker_insecure_registries | default([]) | to_json }}" + l_docker_log_options: "{{ docker_log_options | default({}) | to_json }}" + l_docker_additional_registries: "{{ docker_additional_registries | default([]) | to_json }}" + l_docker_blocked_registries: "{{ docker_blocked_registries | default([]) | to_json }}" + # Configure container-engine using the daemon.json file - name: Configure Container Engine template: |