From aa22c30703bf43b09b3d5111b477993b03cf32ba Mon Sep 17 00:00:00 2001 From: olavst-spk Date: Mon, 3 Jun 2024 14:21:16 +0200 Subject: [PATCH] Move cni_plugins, crictl & etcd to subfolders in /opt/k8s --- manifests/install/cni_plugins.pp | 17 ++--------------- manifests/install/crictl.pp | 15 ++------------- manifests/server/etcd/setup.pp | 15 ++------------- 3 files changed, 6 insertions(+), 41 deletions(-) diff --git a/manifests/install/cni_plugins.pp b/manifests/install/cni_plugins.pp index ea3bbc7..218611f 100644 --- a/manifests/install/cni_plugins.pp +++ b/manifests/install/cni_plugins.pp @@ -24,29 +24,16 @@ case $method { 'tarball', 'loose': { - file { '/opt/cni-plugins': - ensure => stdlib::ensure($ensure, 'directory'), - purge => true, - recurse => true, - force => true, - } - $_url = k8s::format_url($download_url_template, { version => $version, }) - $_target = "/opt/cni-plugins/${version}"; - $_tarball_target = '/opt/cni-plugins/archives'; + $_target = "/opt/k8s/cni-${version}"; + $_tarball_target = '/opt/k8s/archives'; file { $_target: ensure => stdlib::ensure($ensure, 'directory'), } - file { $_tarball_target: - ensure => stdlib::ensure($ensure, 'directory'), - purge => true, - recurse => true, - } - archive { 'cni-plugins': ensure => $ensure, path => "${_tarball_target}/cni-plugins-linux-${version}.tgz", diff --git a/manifests/install/crictl.pp b/manifests/install/crictl.pp index 7b1b644..6b23444 100644 --- a/manifests/install/crictl.pp +++ b/manifests/install/crictl.pp @@ -31,27 +31,16 @@ $config_require = Package[$pkg] } else { - file { '/opt/cri-tools': - ensure => stdlib::ensure($ensure, 'directory'), - purge => true, - recurse => true, - force => true, - } - $_url = k8s::format_url($download_url_template, { version => $version, }) - $_target = "/opt/cri-tools/${version}"; - $_tarball_target = '/opt/cri-tools/archives'; + $_target = "/opt/k8s/crictl-${version}"; + $_tarball_target = '/opt/k8s/archives'; file { $_target: ensure => stdlib::ensure($ensure, 'directory'), } - file { $_tarball_target: - ensure => stdlib::ensure($ensure, 'directory'), - } - archive { 'crictl': ensure => $ensure, path => "${_tarball_target}/crictl-${version}-linux.tar.gz", diff --git a/manifests/server/etcd/setup.pp b/manifests/server/etcd/setup.pp index f1159e2..b54a459 100644 --- a/manifests/server/etcd/setup.pp +++ b/manifests/server/etcd/setup.pp @@ -78,26 +78,15 @@ Optional[Integer[0, 65535]] $gid = undef, ) { if $install == 'archive' { - file { '/opt/etcd': - ensure => stdlib::ensure($ensure, 'directory'), - purge => true, - recurse => true, - force => true, - } - $_url = k8s::format_url($archive_template, { version => $version, }) $_file = basename($_url) - $_target = "/opt/etcd/${version}"; - $_tarball_target = '/opt/etcd/archives'; + $_target = "/opt/k8s/etcd-${version}"; + $_tarball_target = '/opt/k8s/archives'; file { $_target: ensure => stdlib::ensure($ensure, 'directory'), } - file { $_tarball_target: - ensure => stdlib::ensure($ensure, 'directory'), - } - archive { 'etcd': ensure => $ensure, path => "${_tarball_target}/${_file}",