From 84aef20eb7c95c571bd9ee24adb3c8425b7e0453 Mon Sep 17 00:00:00 2001 From: David Phayanouvong Date: Fri, 24 Feb 2023 18:20:39 +0100 Subject: [PATCH] Update docker compose version & deploy it as docker plugin --- manifests/compose.pp | 16 ++++++++++++++++ manifests/params.pp | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/manifests/compose.pp b/manifests/compose.pp index c0dec680..21d701ee 100644 --- a/manifests/compose.pp +++ b/manifests/compose.pp @@ -56,6 +56,7 @@ $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 { @@ -97,6 +98,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 +119,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 8a8580dd..d62f55b3 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -91,7 +91,7 @@ if ($facts['os']['family'] == 'windows') { $compose_install_path = "${::docker_program_files_path}/Docker" - $compose_version = '1.29.2' + $compose_version = '2.16.0' $docker_ee_package_name = 'Docker' $machine_install_path = "${::docker_program_files_path}/Docker" $tls_cacert = "${::docker_program_data_path}/docker/certs.d/ca.pem" @@ -99,7 +99,7 @@ $tls_key = "${::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'