So I am creating a state file to install MatterMost on a minion. So far it looks like this:
mattermost-usergroup:
user.present:
- name: mattermost
- shell: /bin/sh
- createhome: False
- usergroup: True
- system: True
- require:
# From postgresql-formula:
# https://github.com/saltstack-formulas/postgres-formula/blob/master/postgres/server/init.sls#L278
- service: postgresql-running
mattermost-opt:
archive.extracted:
- name: /opt
- source: https://releases.mattermost.com/{{ pillar['mattermost'].version }}/mattermost-{{ pillar['mattermost'].version }}-linux-amd64.tar.gz
- source_hash: a194fd3d2bebed8e6b5721261621030e573f4500c54fb251cfd8ff6f32fe714e
- user: mattermost
- group: mattermost
- require:
- user: mattermost-usergroup
My problem is: Prior to creating this SLS, MatterMost has been installed (exact same version as the one specified in the pillar) by downloading the tarball to an admin's home, then extracting the tarball manually to opt
. If I run state.highstate
with this, I fear it will redownload the tarball, then because the tarball is 'new' (from the Minion's POV), it will be extracted over the existing installation in /opt
How do I "pre-seed" the Minion's "archive cache" so the Minion can see the file is already downloaded, and will not (re)download+overwrite?