fix(archive): add destname pillar value for binary archive

This commit is contained in:
Michael Schmitt 2022-04-26 00:51:24 -06:00
parent ccfd42f7ee
commit abbeb777a5
No known key found for this signature in database
GPG key ID: 5145CC5841E00C15
2 changed files with 4 additions and 9 deletions

View file

@ -26,11 +26,7 @@ packages-archive-unwanted-{{ file_or_directory }}:
# wanted 'archive' software
{%- for package, archive in wanted_archives.items() %}
{%- if archive.dl.format in ('bin',) %}
{%- set archivename = package %}
{%- else %}
{%- set archivename = archive.dl.source.split('/')[-1] %}
{%- endif %}
{%- set archivename = archive.dl.source.split('/')[-1] if 'destname' not in archive else archive.destname %}
packages-archive-wanted-target-{{ package }}-directory:
file.directory:

View file

@ -146,14 +146,13 @@ packages:
# yamllint disable-line rule:line-length
source: https://raw.githubusercontent.com/openstack/cinder/master/contrib/block-box/docker-compose.yml
hashsum: 1751f8e4f6b4cddd8c4843a0f4473274
# If the format is "bin", the resource name will be used as the filename.
# Thus, the following block creates /usr/local/bin/yq
yq:
kubectl:
dest: /usr/local/bin
destname: kubectl # optional destination filename
dl:
format: bin
# yamllint disable-line rule:line-length
source: https://github.com/mikefarah/yq/releases/download/v4.13.4/yq_linux_amd64
source: https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/darwin/amd64/kubectl
unwanted:
- /usr/local/boring_archive_software