A module to wrap (non-Windows) archive calls
New in version 2014.1.0.
Uses the gunzip command to unpack gzip files
CLI Example to create /tmp/sourcefile.txt:
salt '*' archive.gunzip /tmp/sourcefile.txt.gz
The template arg can be set to 'jinja' or another supported template engine to render the command arguments before execution.
CLI Example:
salt '*' archive.gunzip template=jinja /tmp/{{grains.id}}.txt.gz
Uses the gzip command to create gzip files
CLI Example to create /tmp/sourcefile.txt.gz:
salt '*' archive.gzip /tmp/sourcefile.txt
The template arg can be set to 'jinja' or another supported template engine to render the command arguments before execution.
CLI Example:
salt '*' archive.gzip template=jinja /tmp/{{grains.id}}.txt
Uses the rar command to create rar files Uses rar for Linux from http://www.rarlab.com/
CLI Example:
salt '*' archive.rar /tmp/rarfile.rar /tmp/sourcefile1,/tmp/sourcefile2
The template arg can be set to 'jinja' or another supported template engine to render the command arguments before execution.
For example:
salt '*' archive.rar template=jinja /tmp/rarfile.rar /tmp/sourcefile1,/tmp/{{grains.id}}.txt
Note
This function has changed for version 0.17.0. In prior versions, the cwd and template arguments must be specified, with the source directories/files coming as a space-separated list at the end of the command. Beginning with 0.17.0, sources must be a comma-separated list, and the cwd and template arguments are optional.
Uses the tar command to pack, unpack, etc tar files
CLI Example:
salt '*' archive.tar cjvf /tmp/tarfile.tar.bz2 /tmp/file_1,/tmp/file_2
The template arg can be set to jinja or another supported template engine to render the command arguments before execution. For example:
salt '*' archive.tar cjvf /tmp/salt.tar.bz2 {{grains.saltpath}} template=jinja
To unpack a tarfile, for example:
salt '*' archive.tar xf foo.tar dest=/target/directory
Uses the unrar command to unpack rar files Uses rar for Linux from http://www.rarlab.com/
CLI Example:
salt '*' archive.unrar /tmp/rarfile.rar /home/strongbad/ excludes=file_1,file_2
The template arg can be set to 'jinja' or another supported template engine to render the command arguments before execution.
For example:
salt '*' archive.unrar template=jinja /tmp/rarfile.rar /tmp/{{grains.id}}/ excludes=file_1,file_2
Uses the unzip command to unpack zip files
CLI Example:
salt '*' archive.unzip /tmp/zipfile.zip /home/strongbad/ excludes=file_1,file_2
The template arg can be set to 'jinja' or another supported template engine to render the command arguments before execution.
For example:
salt '*' archive.unzip template=jinja /tmp/zipfile.zip /tmp/{{grains.id}}/ excludes=file_1,file_2
Uses the zip command to create zip files
CLI Example:
salt '*' archive.zip /tmp/zipfile.zip /tmp/sourcefile1,/tmp/sourcefile2
The template arg can be set to 'jinja' or another supported template engine to render the command arguments before execution.
For example:
salt '*' archive.zip template=jinja /tmp/zipfile.zip /tmp/sourcefile1,/tmp/{{grains.id}}.txt
Docs for previous releases are available on salt.rtfd.org.
Latest Salt release: 2014.1.13
Try the shiny new release candidate of Salt, v2014.7.0rc6! More info here.
Upcoming SaltStack events, webinars and local meet ups and user groups.