Skip to content

Commit

Permalink
Update docker compomse url download
Browse files Browse the repository at this point in the history
  • Loading branch information
davidphay committed Mar 7, 2023
1 parent 9d18e68 commit 35cf47a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 21 additions & 1 deletion manifests/compose.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,17 @@

$docker_compose_location = "${install_path}/${symlink_name}${file_extension}"
$docker_compose_location_versioned = "${install_path}/docker-compose-${version}${file_extension}"
$docker_plugins_path = '/usr/local/lib/docker/cli-plugins'

if $ensure == 'present' {
if $raw_url != undef {
$docker_compose_url = $raw_url
} else {
$docker_compose_url = "${base_url}/${version}/docker-compose-${facts['kernel']}-${facts['os']['hardware']}${file_extension}"
if $version =~ /2[.]\d+[.]\d+$/ {
$version_prepath = 'v'
}

$docker_compose_url = "${base_url}/${version_prepath}${version}/docker-compose-${facts['kernel']}-${facts['os']['hardware']}${file_extension}"
}

if $proxy != undef {
Expand Down Expand Up @@ -97,6 +102,15 @@
require => Package['curl'],
}

file { '/usr/local/lib/docker':
ensure => directory,
}

file { $docker_plugins_path:
ensure => directory,
require => File['/usr/local/lib/docker'],
}

file { $docker_compose_location_versioned:
owner => $file_owner,
mode => '0755',
Expand All @@ -109,6 +123,12 @@
target => $docker_compose_location_versioned,
require => File[$docker_compose_location_versioned],
}

file { "${docker_plugins_path}/docker-compose":
ensure => 'link',
target => $docker_compose_location_versioned,
require => File[$docker_plugins_path],
}
}
} else {
file { $docker_compose_location_versioned:
Expand Down
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@

if ($facts['os']['family'] == 'windows') {
$compose_install_path = "${facts['docker_program_files_path']}/Docker"
$compose_version = '1.29.2'
$compose_version = '2.16.0'
$docker_ee_package_name = 'Docker'
$machine_install_path = "${facts['docker_program_files_path']}/Docker"
$tls_cacert = "${facts['docker_program_data_path']}/docker/certs.d/ca.pem"
$tls_cert = "${facts['docker_program_data_path']}/docker/certs.d/server-cert.pem"
$tls_key = "${facts['docker_program_data_path']}/docker/certs.d/server-key.pem"
} else {
$compose_install_path = '/usr/local/bin'
$compose_version = '1.29.2'
$compose_version = '2.16.0'
$docker_ee_package_name = 'docker-ee'
$machine_install_path = '/usr/local/bin'
$tls_cacert = '/etc/docker/tls/ca.pem'
Expand Down

0 comments on commit 35cf47a

Please sign in to comment.