Merge "Add docker proxy configuration for kubernetes"
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
class platform::docker::params (
|
||||
$package_name = 'docker-ce',
|
||||
$package_name = 'docker-ce',
|
||||
$http_proxy = undef,
|
||||
$https_proxy = undef,
|
||||
$no_proxy = undef,
|
||||
) { }
|
||||
|
||||
class platform::docker::config
|
||||
@@ -9,6 +12,22 @@ class platform::docker::config
|
||||
|
||||
if $::platform::kubernetes::params::enabled {
|
||||
|
||||
if $http_proxy or $https_proxy {
|
||||
file { '/etc/systemd/system/docker.service.d':
|
||||
ensure => 'directory',
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
-> file { '/etc/systemd/system/docker.service.d/http-proxy.conf':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
content => template('platform/dockerproxy.conf.erb'),
|
||||
}
|
||||
}
|
||||
|
||||
Class['::platform::filesystem::docker'] ~> Class[$name]
|
||||
|
||||
service { 'docker':
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
[Service]
|
||||
<%- if @http_proxy -%>
|
||||
Environment="HTTP_PROXY=<%= @http_proxy %>"
|
||||
<%- end -%>
|
||||
<%- if @https_proxy -%>
|
||||
Environment="HTTPS_PROXY=<%= @https_proxy %>"
|
||||
<%- end -%>
|
||||
Environment="NO_PROXY=<%= @no_proxy %>"
|
||||
Reference in New Issue
Block a user