3 # TODO This would be better in puppet
5 # TODO remove this when built image includes docker
6 if [ ! -f "/usr/bin/docker" ]; then
10 # NOTE(mandre) $docker_namespace_is_registry is not a bash variable but is
11 # a place holder for text replacement done via heat
12 if [ "$docker_namespace_is_registry" = "True" ]; then
13 /usr/bin/systemctl stop docker.service
14 # if namespace is used with local registry, trim all namespacing
15 trim_var=$docker_registry
16 registry_host="${trim_var%%/*}"
17 /bin/sed -i -r "s/^[# ]*INSECURE_REGISTRY *=.+$/INSECURE_REGISTRY='--insecure-registry $registry_host'/" /etc/sysconfig/docker
20 # enable and start docker
21 /usr/bin/systemctl enable docker.service
22 /usr/bin/systemctl start docker.service
25 /usr/bin/systemctl disable libvirtd.service
26 /usr/bin/systemctl stop libvirtd.service