'Create an archive of a given ``source_dir`` to ``output_path``.
:param source_dir:  Path to the directory to be archived.
:type source_dir: ``str``'

def _create_tar(self, source_dir):

    old_umask = os.umask(int('0077', 8))
    archive_path = self.module.params.get('archive_path')
    if (not os.path.isdir(archive_path)):
        os.makedirs(archive_path)
    archive_compression = self.module.params.get('archive_compression')
    compression_type = LXC_COMPRESSION_MAP[archive_compression]
    archive_name = ('%s.%s' % (os.path.join(archive_path, self.container_name), compression_type['extension']))
    build_command = [self.module.get_bin_path('tar', True), ('--directory=%s' % os.path.realpath(os.path.expanduser(source_dir))), compression_type['argument'], archive_name, '.']
    (rc, stdout, err) = self._run_command(build_command=build_command, unsafe_shell=True)
    os.umask(old_umask)
    if (rc != 0):
        self.failure(err=err, rc=rc, msg='failed    to    create    tar    archive', command='    '.join(build_command))
    return archive_name
