Open brianthelion opened 5 years ago
@brianthelion Thank you for reporting this issue.
I am able to replicate it.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
Thank you for updating this issue. It is no longer marked as stale.
I just ran into this on 3001rc1, and it occurs even when I specify archive_format: tar
. any ETA on getting this fixed?
The problem here is that ubuntu-18.04.3-preinstalled-server-arm64+raspi3.img.xz
is not an "archive" file, such as the tar
, zip
, rar
or cpio
archive formats (although even cpio doesn't seem to be supported). Instead, it would only extract to a single file - ubuntu-18.04.3-preinstalled-server-arm64+raspi3.img
. The image file may contain many files within, but that's only because you can mount it once extracted (since will probably contain a file system), but this is not a true archive format. Essentially it would be treated as a single file that just happens to be compressed.
I'm facing a similar issue. I was hoping I could use archive.extracted
to extract /usr/share/doc/rsync/scripts/rrsync.gz
, but that too isn't an archive file - it's just a single file (the rrsync
Perl script) that is gzip-compressed. If it were rrsync.tar.gz
, that would be a different story - but wrapping a single file into a tar "archive" would be redundant. Archives are only there to join multiple files together, and I only have a single file.
Perhaps if Salt's archive module were to be renamed "compression", adding this support would make more sense - and I would like to see this support added in some form. Alternatively, it might make more sense to just add the required new functionality into a separate module.
Browsing through the source code, I see xz-compressed archives (ie. .tar.xz
files) are supported. Typically xz-compression would be used with tar archives to compress multiple files, since rar and zip archive formats have compression support built-in. By contrast, tar and cpio are pure archive formats and offer no compression, so need to be used with a separate compression library such as those for xz, bzip2, gzip, etc. This is because *NIX tools will typically follow the tradition of only doing one thing, and doing it well.
Probably this should be marked as not-a-bug/invalid, or alternatively marked as a feature request. In the meantime, you might want to use file.managed
to fetch the file, and then something like this:
Extract /tmp/vendor-images/ubuntu-18.04.3-preinstalled-server-arm64+raspi3/0b29297cf9f2a2112d634b1e29f94507:
cmd.run:
- name: zcat /path/to/ubuntu-18.04.3-preinstalled-server-arm64+raspi3.img.xz > /tmp/vendor-images/ubuntu-18.04.3-preinstalled-server-arm64+raspi3/0b29297cf9f2a2112d634b1e29f94507
- unless: test -s /tmp/vendor-images/ubuntu-18.04.3-preinstalled-server-arm64+raspi3/0b29297cf9f2a2112d634b1e29f94507
- require:
- file: Fetch ubuntu-18.04.3-preinstalled-server-arm64+raspi3.img.xz
Description of Issue
A very vanilla
archive.extracted
state is failing for XZ archives.First, with:
And then with
archive_type: zip
set:Setup
Run the bellow:
Steps to Reproduce Issue
Versions Report