Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing back and forth between different version of an archive does not re-extract #477

Open
dhs-rec opened this issue Nov 15, 2022 · 1 comment

Comments

@dhs-rec
Copy link

dhs-rec commented Nov 15, 2022

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: all
  • Ruby: all
  • Distribution: Windows, but probably all
  • Module version: latest

How to reproduce (e.g Puppet code you use)

  archive { 'some_pkg':
    path          => $some_pkg,
    source        => $some_pkg_remote,
    checksum      => $checksum,
    checksum_type => 'sha256',
    cleanup       => true,
    extract       => true,
    extract_path  => $tools_dir::tools_dir,
    require       => [
      Class['sevenzip'],
      Class['tools_dir'],
    ],
  }

What are you seeing

Rolling out first version of archive some_pkg works fine
Rolling out second version (which has different file name AND checksum) replaces first version, as expected
Trying to roll out first version again (because second version has a bug) does nothing

Also, the local copies of the archives, under path are not removed, despite cleanup => true.

What behaviour did you expect instead

First version should replace second version, no local copy should exist after Puppet agent run

Output log

Well, no action, no log

Additional information

The only way to achieve a rollback to the first version is to write a trigger file containing the checksum, have an exec, subscribed to that file, which removes the extracted directory under extract_path and in turn let archive require that exec

@dhs-rec
Copy link
Author

dhs-rec commented Nov 15, 2022

BTW: The problem could be easily solved by comparing the archives ToC with the actual content of (the directory tree under) extract_path (this is also what Salt does).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant