Nathan Lyon will undergo surgery to repair a torn right hamstring, with Cricket Australia confirming the 38-year-old will be sidelined for an "extended period".