diff options
author | Bogdan Dobrelya <bdobreli@redhat.com> | 2017-06-22 13:38:46 +0200 |
---|---|---|
committer | Bogdan Dobrelya <bdobreli@redhat.com> | 2017-06-27 15:08:52 +0200 |
commit | ee5301929877a5330b93f99e1ca5958ca5963eb5 (patch) | |
tree | 47f8e179fe2df5074593d2bb6800ae1743b8cd33 /manifests/profile | |
parent | dc70e9dfbc4a1c6612659335ae51d9e46b73b4a4 (diff) |
Split docker options and insecure registry
Use augeas to modify only parameters' dedicated configuration.
Split options from insecure registry. Overlapping those params may
unschedule the docker service restarts for some cases, ending up with
a split brain state for the docker service run-time config vs changed
/etc/sysconfig/options config.
Change-Id: Ic5640061837b022f7175f0db0dc269f9a61e6023
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
Diffstat (limited to 'manifests/profile')
-rw-r--r-- | manifests/profile/base/docker.pp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/manifests/profile/base/docker.pp b/manifests/profile/base/docker.pp index 28a2764..cf3a914 100644 --- a/manifests/profile/base/docker.pp +++ b/manifests/profile/base/docker.pp @@ -89,22 +89,34 @@ class tripleo::profile::base::docker ( require => Package['docker'], } + if $docker_options { + $options_changes = [ "set OPTIONS '\"${docker_options}\"'" ] + } else { + $options_changes = [ 'rm OPTIONS' ] + } + + augeas { 'docker-sysconfig-options': + lens => 'Shellvars.lns', + incl => '/etc/sysconfig/docker', + changes => $options_changes, + subscribe => Package['docker'], + notify => Service['docker'], + } + if $insecure_registry { if $docker_namespace == undef { fail('You must provide a $docker_namespace in order to configure insecure registry') } $namespace = strip($docker_namespace.split('/')[0]) - $changes = [ "set INSECURE_REGISTRY '\"--insecure-registry ${namespace}\"'", - "set OPTIONS '\"${docker_options}\"'" ] + $registry_changes = [ "set INSECURE_REGISTRY '\"--insecure-registry ${namespace}\"'" ] } else { - $changes = [ 'rm INSECURE_REGISTRY', - "set OPTIONS '\"${docker_options}\"'" ] + $registry_changes = [ 'rm INSECURE_REGISTRY' ] } - augeas { 'docker-sysconfig': + augeas { 'docker-sysconfig-registry': lens => 'Shellvars.lns', incl => '/etc/sysconfig/docker', - changes => $changes, + changes => $registry_changes, subscribe => Package['docker'], notify => Service['docker'], } |