diff options
author | Zuul <zuul@review.openstack.org> | 2017-11-09 11:21:41 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-11-09 11:21:41 +0000 |
commit | 9387e08b621c2794a68b62cd8f8cda41489990cb (patch) | |
tree | 6cbf66db8b87225e857f32098cadb71203233498 | |
parent | 9ed6fff5d6bf09cb21e3dfea1efb5e1ce047b014 (diff) | |
parent | 56fb267608cb32d62751026d1c9b5496b65d4e9c (diff) |
Merge "Make docker network configurable" into stable/pike
-rw-r--r-- | manifests/profile/base/docker.pp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/manifests/profile/base/docker.pp b/manifests/profile/base/docker.pp index d3f6fe7..8eb6cd3 100644 --- a/manifests/profile/base/docker.pp +++ b/manifests/profile/base/docker.pp @@ -35,6 +35,12 @@ # 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 --iptables=false' # +# [*configure_network*] +# Boolean. Whether to configure the docker network. Defaults to false. +# +# [*network_options*] +# Network options to configure. Defaults to '' +# # [*configure_storage*] # Boolean. Whether to configure a docker storage backend. Defaults to true. # @@ -68,6 +74,8 @@ class tripleo::profile::base::docker ( $insecure_registries = undef, $registry_mirror = false, $docker_options = '--log-driver=journald --signature-verification=false --iptables=false', + $configure_network = false, + $network_options = '', $configure_storage = true, $storage_options = '-s overlay2', $step = Integer(hiera('step')), @@ -190,5 +198,22 @@ class tripleo::profile::base::docker ( require => Package['docker'], } + if $configure_network { + if $network_options == undef { + fail('You must provide a $network_options in order to configure network') + } + $network_changes = [ "set DOCKER_NETWORK_OPTIONS '\" ${network_options}\"'", ] + } else { + $network_changes = [ 'rm DOCKER_NETWORK_OPTIONS', ] + } + + augeas { 'docker-sysconfig-network': + lens => 'Shellvars.lns', + incl => '/etc/sysconfig/docker-network', + changes => $network_changes, + notify => Service['docker'], + require => Package['docker'], + } + } } |