Minor fixes to allow local docker registry usage

Changed the heat-docker-agents namespace to use the namespacing
specified in the environment file, which reduces modifications required
on the user when using a local registry.

Changed the start agents script to handle using a local registry both
with a namespace and without.

Change-Id: I16cc96b7ecddeeda07de45f50ffc6a880dabbba6
This commit is contained in:
Jeff Peeler 2016-01-08 12:20:53 -05:00
parent 8d763fc70c
commit 255f4fd69e
3 changed files with 10 additions and 4 deletions

View File

@ -3,7 +3,7 @@ heat_template_version: 2014-10-16
parameters:
DockerAgentImage:
type: string
default: tripleoupstream/heat-docker-agents
default: heat-docker-agents
DockerNamespace:
type: string
default: kollaglue
@ -26,7 +26,10 @@ resources:
config:
str_replace:
params:
$agent_image: {get_param: DockerAgentImage}
$agent_image:
list_join:
- '/'
- [ {get_param: DockerNamespace}, {get_param: DockerAgentImage} ]
$docker_registry: {get_param: DockerNamespace}
$docker_namespace_is_registry: {get_param: DockerNamespaceIsRegistry}
template: {get_file: ./start_docker_agents.sh}

View File

@ -39,7 +39,10 @@ EOF
# Local docker registry 1.8
if [ $docker_namespace_is_registry ]; then
/bin/sed -i "s/# INSECURE_REGISTRY='--insecure-registry '/INSECURE_REGISTRY='--insecure-registry $docker_registry'/g" /etc/sysconfig/docker
# if namespace is used with local registry, trim all namespacing
trim_var=$docker_registry
registry_host="${trim_var%%/*}"
/bin/sed -i "s/# INSECURE_REGISTRY='--insecure-registry'/INSECURE_REGISTRY='--insecure-registry $registry_host'/g" /etc/sysconfig/docker
fi
/sbin/setenforce 0

View File

@ -8,7 +8,7 @@ parameters:
parameter_defaults:
# Defaults to 'tripleoupstream'. Specify a local docker registry
# Example: 192.168.122.131:8787
# Example: 192.0.2.1:8787/tripleoupstream
DockerNamespace: tripleoupstream
# Enable local Docker registry
DockerNamespaceIsRegistry: false