summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/cicdansible/ansible.cfg1
-rw-r--r--tools/cicdansible/group_vars/all.yml2
-rw-r--r--tools/cicdansible/roles/configure_instances/templates/daemon.json.j218
3 files changed, 20 insertions, 1 deletions
diff --git a/tools/cicdansible/ansible.cfg b/tools/cicdansible/ansible.cfg
index e74dda58..8ffd6ee2 100644
--- a/tools/cicdansible/ansible.cfg
+++ b/tools/cicdansible/ansible.cfg
@@ -4,6 +4,7 @@
stdout_callback=debug
#Default verbosity level, for logging all module outputs.
verbosity=1
+jinja2_extensions = jinja2.ext.do
[inventory]
#Fail when inventory parsing fails.
diff --git a/tools/cicdansible/group_vars/all.yml b/tools/cicdansible/group_vars/all.yml
index 3165e374..e4265b11 100644
--- a/tools/cicdansible/group_vars/all.yml
+++ b/tools/cicdansible/group_vars/all.yml
@@ -42,6 +42,8 @@ router_addr: "10.1.0.1"
external_subnet_cidr: ""
#Address of cicd docker registry.
cicd_docker_registry: ""
+#Address of custom docker registry mirror
+docker_registry_mirror: ""
#Number of nodes to deploy.
num_nodes: "3"
#Stack name to deploy on heat.
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 %}