diff options
author | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2020-12-11 13:57:08 +0100 |
---|---|---|
committer | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2020-12-30 10:13:14 +0000 |
commit | fa807fc95ae404f9bdd2f0ed80906ea96bc79a46 (patch) | |
tree | f7cdc60d227de5e1ca3607ce35b3b7d9958ad597 /tools/cicdansible/roles | |
parent | b0b87b21a194d473eb85479c62ec6a92827bb767 (diff) |
Support setting custom docker registry mirror in cicdansible
This facility allows setting custom docker registry mirror on k8s
hosts in Docker global config.
Change-Id: I01d02bdbabf2bed0b5b55819ae22770dd52de771
Issue-ID: OOM-2650
Signed-off-by: Bartek Grzybowski <b.grzybowski@partner.samsung.com>
Diffstat (limited to 'tools/cicdansible/roles')
-rw-r--r-- | tools/cicdansible/roles/configure_instances/templates/daemon.json.j2 | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/cicdansible/roles/configure_instances/templates/daemon.json.j2 b/tools/cicdansible/roles/configure_instances/templates/daemon.json.j2 index 1c3ca9bb..01e5e512 100644 --- a/tools/cicdansible/roles/configure_instances/templates/daemon.json.j2 +++ b/tools/cicdansible/roles/configure_instances/templates/daemon.json.j2 @@ -1,3 +1,19 @@ +{% set insecure_registries = [] %} +{% for registry in [cicd_docker_registry, docker_registry_mirror] %} +{% if registry|length > 0 %} +{% do insecure_registries.append(registry) %} +{% endif %} +{% endfor %} { -"insecure-registries": ["{{ cicd_docker_registry }}"] +"insecure-registries": [ +{%- for registry in insecure_registries %} +"{{ registry }}"{% if not loop.last %}, {% else %}]{% endif %} +{% endfor %} +{% if docker_registry_mirror|length > 0 %} +, +"registry-mirrors": ["http://{{ docker_registry_mirror }}"] } +{% else %} + +} +{% endif %} |