I'm trying to extract tar file using salt archive.extracted command
its state skeleton looks like this:
download_extract:
archive.extracted:
- name: /opt/
- if_missing: /opt/
- source: {{ settings.binaries_url }}
- source_hash: {{ settings.hash_url }}
- user: {{ settings.env.user }}
- group: {{ settings.env.user }}
- enforce_ownership_on: /opt/
the tar contains a root directory ( /foo and files under it).
what I expect is to get:
/opt/foo/*all the content @ foo*
but what I get is:
/opt/foo/foo/*all the content @ foo*
can u help?
thanks.
Your tar archive probably has a top-level or leading directory. You can skip this directory by adding the two items below.
download_extract:
archive.extracted:
- name: /opt/
- if_missing: /opt/
- source: {{ settings.binaries_url }}
- source_hash: {{ settings.hash_url }}
- user: {{ settings.env.user }}
- group: {{ settings.env.user }}
- enforce_ownership_on: /opt/
- enforce_toplevel: False
- options: --strip-components=1