Munster captain Peter O'Mahony has been ruled out for the rest of the season after undergoing shoulder surgery on Wednesday morning.