After initially ruling out leading the Lions again, Warren Gatland said he could not refuse the chance to gain revenge in South Africa.
Departing Wales head coach Warren Gatland will take charge of the British and Irish Lions for a third time.
Warren Gatland will make a swift return to Wales to take on Wayne Pivac's side with the Barbarians in November.
Wales coach Shaun Edwards has urged focus on this year's World Cup and not his next career move following comments by Wayne Pivac.
Scotland full-back Stuart Hogg has welcomed reports that Warren Gatland will coach the Lions in South Africa in two years' time.
Warren Gatland has had numerous approaches about coaching roles after he leaves Wales, but has not received one from England.
Wales have announced their 42-man training squad in preparation for the 2019 Rugby World Cup.
Wales took on all comers in the Six Nations and Warren Gatland says they can go far in Japan.
Wales will say goodbye to Warren Gatland later this year and the coach hopes he has instilled lasting values in the team.
Eddie Jones said Wales looked tired ahead of their match against Ireland and Warren Gatland felt their performance proved him wrong.