From 35cf47a1183143f0c95d2e621fae8230510b1c3e Mon Sep 17 00:00:00 2001 From: David Phayanouvong Date: Fri, 24 Feb 2023 18:20:39 +0100 Subject: [PATCH] Update docker compomse url download --- manifests/compose.pp | 22 +++++++++++++++++++++- manifests/params.pp | 4 ++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/manifests/compose.pp b/manifests/compose.pp index a5e8a9c3..94648739 100644 --- a/manifests/compose.pp +++ b/manifests/compose.pp @@ -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 { @@ -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', @@ -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: diff --git a/manifests/params.pp b/manifests/params.pp index c7d1e115..b85ce6ca 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -91,7 +91,7 @@ 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" @@ -99,7 +99,7 @@ $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'