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

[FEATURE] (archive.sls) Keep idempotency if the wanted package is a file inside a tarball? #89

Open
mdschmitt opened this issue May 27, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@mdschmitt
Copy link
Contributor

mdschmitt commented May 27, 2022

Is your feature request related to a problem?

Every time I run state.apply, it module.runs file.check_hash and extracts the binary from the tarball.

Describe the solution you'd like

I'm not exactly sure how, but it'd be neat if things were idempotent when installing packages that are really just binaries inside tarballs.

Describe alternatives you've considered

N/A

Additional context

I could absolutely be misusing it, so maybe there's a better way?
Pillar:

packages:
  tmpdir: /var/cache/salt/minion/extrn_files
  archives:
    wanted:
      rg:
        dest: /usr/local/bin
        dl:
          format: tar
          source: https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep-13.0.0-x86_64-unknown-linux-musl.tar.gz
          hashsum: ee4e0751ab108b6da4f47c52da187d5177dc371f0f512a7caaec5434e711c091
        options: '--strip-components=1 --no-same-owner ripgrep-13.0.0-x86_64-unknown-linux-musl/rg'

Output on state.apply regardless of whether or not the file's already there and correct:

      ID: packages-archive-wanted-rg-check-hashsum
Function: module.run
    Name: file.check_hash
  Result: True
 Comment: Module function file.check_hash executed
 Started: 00:45:00.061936
Duration: 6.53 ms
 Changes:
          ----------
          ret:
              True

      ID: packages-archive-wanted-install-rg
Function: archive.extracted
    Name: /usr/local/bin/
  Result: True
 Comment: /var/cache/salt/minion/extrn_files/ripgrep-13.0.0-x86_64-unknown-linux-musl.tar.gz extracted to /usr/local/bin/, due to absence of one or more files/dirs. Output was trimmed to False number of lines
 Started: 00:45:00.068953
Duration: 112.007 ms
 Changes:
          ----------
          extracted_files:
              - ripgrep-13.0.0-x86_64-unknown-linux-musl/rg
@mdschmitt mdschmitt added the enhancement New feature or request label May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant