Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Make vault-helper download URL customizable #395

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions puppet/modules/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ Class: kubernetes
* Type: `Any`
* Default: `$::kubernetes::params::download_dir`

##### `download_url`

* Type: `Any`
* Default: `$::kubernetes::params::download_url`

##### `dest_dir`

* Type: `Any`
Expand Down
5 changes: 3 additions & 2 deletions puppet/modules/kubernetes/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
$version = $::kubernetes::params::version,
$bin_dir = $::kubernetes::params::bin_dir,
$download_dir = $::kubernetes::params::download_dir,
$download_url = $::kubernetes::params::download_url,
$dest_dir = $::kubernetes::params::dest_dir,
$config_dir = $::kubernetes::params::config_dir,
$systemd_dir = $::kubernetes::params::systemd_dir,
Expand Down Expand Up @@ -96,8 +97,8 @@
$_master_url = $master_url
}

$download_url = regsubst(
$::kubernetes::params::download_url,
$real_download_url = regsubst(
$download_url,
'#VERSION#',
$version,
'G'
Expand Down
2 changes: 1 addition & 1 deletion puppet/modules/kubernetes/manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
mode => '0755',
}
-> exec {"kubernetes-${kubernetes::version}-download":
command => "curl -sL -o ${hyperkube_path} ${::kubernetes::download_url}",
command => "curl -sL -o ${hyperkube_path} ${::kubernetes::real_download_url}",
creates => $hyperkube_path,
path => ['/usr/bin/', '/bin'],
}
Expand Down
9 changes: 9 additions & 0 deletions puppet/modules/vault_client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Puppet module to install and manage a vault client install
[*init_role*]
TODO

[*download_url*]
Download url for the `vault-helper` binary. It supports the placeholder `#VERSION#`
that gets replaced by `$version` variable.

#### Parameters

##### `version`
Expand All @@ -55,6 +59,11 @@ Puppet module to install and manage a vault client install
* Type: `Any`
* Default: `$::vault_client::params::download_dir`

##### `download_url`

* Type: `Any`
* Default: `$::vault_client::params::download_url`

##### `dest_dir`

* Type: `Any`
Expand Down
5 changes: 3 additions & 2 deletions puppet/modules/vault_client/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
$version = $::vault_client::params::version,
$bin_dir = $::vault_client::params::bin_dir,
$download_dir = $::vault_client::params::download_dir,
$download_url = $::vault_client::params::download_url,
$dest_dir = $::vault_client::params::dest_dir,
$server_url = $::vault_client::params::server_url,
$systemd_dir = $::vault_client::params::systemd_dir,
Expand All @@ -51,8 +52,8 @@
}

## build download URL
$download_url = regsubst(
$::vault_client::params::download_url,
$real_download_url = regsubst(
$download_url,
'#VERSION#',
$version,
'G'
Expand Down
2 changes: 1 addition & 1 deletion puppet/modules/vault_client/manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
mode => '0755',
}
-> exec {"vault-helper-${vault_client::version}-download":
command => "curl -sL ${::vault_client::download_url} -o ${vault_helper_path}/vault-helper",
command => "curl -sL ${::vault_client::real_download_url} -o ${vault_helper_path}/vault-helper",
creates => "${vault_helper_path}/vault-helper",
path => ['/usr/bin', '/bin'],
}
Expand Down