The X-ray/SZ view of the virial region: II. Gas mass fraction