Ronan O'Gara has agreed to become assistant coach of Racing Metro after announcing his retirement from rugby.