File tree Expand file tree Collapse file tree 2 files changed +28
-5
lines changed Expand file tree Collapse file tree 2 files changed +28
-5
lines changed Original file line number Diff line number Diff line change 20
20
# [*proxy*]
21
21
# Proxy to use for downloading Docker Machine.
22
22
#
23
+ # [*url*]
24
+ # The URL from which the docker machine binary should be fetched
25
+ # Defaults to a auto determined value based on version, kernel and OS.
23
26
class docker::machine (
24
- Optional[Pattern[/^present $|^absent $/]] $ensure = ' present' ,
25
- Optional[String] $version = $docker::params::machine_version,
26
- Optional[String] $install_path = $docker::params::machine_install_path,
27
- Optional[String] $proxy = undef
27
+ Optional[Pattern[/^present $|^absent $/]] $ensure = ' present' ,
28
+ Optional[String] $version = $docker::params::machine_version,
29
+ Optional[String] $install_path = $docker::params::machine_install_path,
30
+ Optional[String] $proxy = undef ,
31
+ Optional[Variant[Stdlib::HTTPUrl, Stdlib::HTTPSUrl]] $url = undef ,
28
32
) inherits docker::params {
29
33
30
34
if $proxy != undef {
43
47
$docker_machine_location_versioned = " ${install_path} /docker-machine-${version}${file_extension} "
44
48
45
49
if $ensure == ' present' {
46
- $docker_machine_url = " https://github.com/docker/machine/releases/download/v${version} /docker-machine-${::kernel} -x86_64${file_extension} "
50
+ $docker_machine_url = $url ? {
51
+ undef => " https://github.com/docker/machine/releases/download/v${version} /docker-machine-${::kernel} -x86_64${file_extension} " ,
52
+ default => $url ,
53
+ }
47
54
48
55
if $proxy != undef {
49
56
$proxy_opt = " --proxy ${proxy} "
Original file line number Diff line number Diff line change 113
113
)
114
114
}
115
115
end
116
+
117
+ context 'with docker_machine_url is provided' do
118
+ let ( :params ) do
119
+ {
120
+ version : '0.16.2' ,
121
+ url : 'https://gitlab-docker-machine-downloads.s3.amazonaws.com/v0.16.2-gitlab.3/docker-machine' ,
122
+ }
123
+ end
124
+
125
+ it { is_expected . to compile }
126
+ it {
127
+ is_expected . to contain_exec ( 'Install Docker Machine 0.16.2' ) . with_command (
128
+ 'curl -s -S -L https://gitlab-docker-machine-downloads.s3.amazonaws.com/v0.16.2-gitlab.3/docker-machine -o /usr/local/bin/docker-machine-0.16.2' ,
129
+ )
130
+ }
131
+ end
116
132
end
You can’t perform that action at this time.
0 commit comments