MADRID, Dec 27 (Reuters) - Telefonica (TEF.MC) has bought 5G network equipment from Swedish manufacturer Ericsson (ERICb.ST) to replace some of the Huawei gear it has rolled out in Spain, a source at the Spanish firm said on Monday, confirming a report in Expansion newspaper.