aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/profile/base
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-04-11 06:10:03 +0000
committerGerrit Code Review <review@openstack.org>2017-04-11 06:10:03 +0000
commitb10fa039b3db88908f3e9501d60750de9ffea073 (patch)
tree157808418d8f0618e40bf7715413425bb376b5a8 /manifests/profile/base
parentdc6eedcb50b4ddbd0ef27e6cc24e2d2889ae0985 (diff)
parent936aece1de21a5c333b93d711444200c00e2419f (diff)
Merge "Add registry_mirror to base::docker profile"
Diffstat (limited to 'manifests/profile/base')
-rw-r--r--manifests/profile/base/docker.pp23
1 files changed, 23 insertions, 0 deletions
diff --git a/manifests/profile/base/docker.pp b/manifests/profile/base/docker.pp
index 5e18a85..4797d86 100644
--- a/manifests/profile/base/docker.pp
+++ b/manifests/profile/base/docker.pp
@@ -28,12 +28,17 @@
# Set docker_namespace to INSECURE_REGISTRY, used when a local registry
# is enabled (defaults to false)
#
+# [*registry_mirror*]
+# Configure a registry-mirror in the /etc/docker/daemon.json file.
+# (defaults to false)
+#
# [*step*]
# step defaults to hiera('step')
#
class tripleo::profile::base::docker (
$docker_namespace = undef,
$insecure_registry = false,
+ $registry_mirror = false,
$step = hiera('step'),
) {
if $step >= 1 {
@@ -64,5 +69,23 @@ class tripleo::profile::base::docker (
subscribe => Package['docker'],
notify => Service['docker'],
}
+
+ if $registry_mirror {
+ $mirror_changes = [
+ 'set dict/entry[. = "registry-mirrors"] "registry-mirrors',
+ "set dict/entry[. = \"registry-mirrors\"]/array/string \"${registry_mirror}\""
+ ]
+ } else {
+ $mirror_changes = [ 'rm dict/entry[. = "registry-mirrors"]', ]
+ }
+
+ augeas { 'docker-daemon.json':
+ lens => 'Json.lns',
+ incl => '/etc/docker/daemon.json',
+ changes => $mirror_changes,
+ subscribe => Package['docker'],
+ notify => Service['docker'],
+ }
+
}
}