tar autocompress

To figure out which compression to use based of the archive extension use autocompress option:
long format is --autocompress
short format - a or -a

Example:

tar caf /tmp/archive_etc.tar.gz etc