diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-05-19 17:30:47 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-05-19 17:30:47 +0000 |
commit | 3eec2c533044dc82d02946950b794338f2286746 (patch) | |
tree | 8c907054479fdecd79d672b98286064b25f0a6ce /manifests/profile/base | |
parent | 3c2852ccfc465fb83da8e62d67ccaa7f7e9ff08d (diff) | |
parent | 6b17c04e364bc5827ded3e4357f95cb007f73590 (diff) |
Merge "Switch to overlay2 driver for storage"
Diffstat (limited to 'manifests/profile/base')
-rw-r--r-- | manifests/profile/base/docker.pp | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/manifests/profile/base/docker.pp b/manifests/profile/base/docker.pp index d035f6a..bc784b5 100644 --- a/manifests/profile/base/docker.pp +++ b/manifests/profile/base/docker.pp @@ -32,6 +32,18 @@ # Configure a registry-mirror in the /etc/docker/daemon.json file. # (defaults to false) # +# [*docker_options*] +# OPTIONS that are used to startup the docker service. NOTE: +# --selinux-enabled is dropped due to recommendations here: +# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/7.2_Release_Notes/technology-preview-file_systems.html +# Defaults to '--log-driver=journald --signature-verification=false' +# +# [*configure_storage*] +# Boolean. Whether to configure a docker storage backend. Defaults to true. +# +# [*storage_options*] +# Storage options to configure. Defaults to '-s overlay2' +# # [*step*] # step defaults to hiera('step') # @@ -39,6 +51,9 @@ class tripleo::profile::base::docker ( $docker_namespace = undef, $insecure_registry = false, $registry_mirror = false, + $docker_options = '--log-driver=journald --signature-verification=false', + $configure_storage = true, + $storage_options = '-s overlay2', $step = hiera('step'), ) { if $step >= 1 { @@ -57,9 +72,11 @@ class tripleo::profile::base::docker ( 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}\"'", ] + $changes = [ "set INSECURE_REGISTRY '\"--insecure-registry ${namespace}\"'", + "set OPTIONS '\"${docker_options}\"'" ] } else { - $changes = [ 'rm INSECURE_REGISTRY', ] + $changes = [ 'rm INSECURE_REGISTRY', + "set OPTIONS '\"${docker_options}\"'" ] } augeas { 'docker-sysconfig': @@ -95,6 +112,20 @@ class tripleo::profile::base::docker ( notify => Service['docker'], require => File['/etc/docker/daemon.json'], } + if $configure_storage { + if $storage_options == undef { + fail('You must provide a $storage_options in order to configure storage') + } + $storage_changes = [ "set DOCKER_STORAGE_OPTIONS '\" ${storage_options}\"'", ] + } else { + $storage_changes = [ 'rm DOCKER_STORAGE_OPTIONS', ] + } + + augeas { 'docker-sysconfig-storage': + lens => 'Shellvars.lns', + incl => '/etc/sysconfig/docker-storage', + changes => $storage_changes, + } } } |