Former Australia opening batsman Justin Langer has quit his role as national team batting coach to become head coach of Western Australia.