We have some binaries for different flavors of Linux that need to get installed only if the version changes. We put the binaries together in a archive because salt and gitfs were having trouble downloading the binaries directly. We have some jinja that sets the SCRIPT variable based on the OS. We have:
download_arch:
archive.extracted:
- source: salt:/software/files/file.tgz
- name: /root/scripts
- source_hash: 586...e4c
- source_hash_update: True
- user: root
- group: root
- mode: 0700
- enforce_toplevel: false
- if_missing: /root/scripts/{{ Script }}
run_file:
cmd.run:
- name:
/root/scripts/{{ Script }}
- onchanges:
- file: download_arch
My onchanges is not correct. I only want the script to run if a new archive is downloaded and extracted.