Claudio Ranieri has been formally appointed as Inter Milan's new manager on a two-year contract following the sacking of Gian Piero Gasperini.