The announcement came shortly after Nice confirmed that Ramsey had left the French club by mutual agreement.
The 32-year-old midfielder and former Arsenal player had arrived in Nice last August on a free transfer and made 34 appearances, scoring once.
Ramsey made his first-team debut at the age of 16 for Cardiff in 2007, having progressed through the ranks of the club's youth academy. He then made a move to Arsenal just a year later.
"It feels unbelievable to finally be back here. I always thought one day I'd come back, and now it's the perfect time to do that," Ramsey said in a statement.
"For me now to come full circle, to be part of this team now, and hopefully achieve the goals we want, there's no better feeling than that."
Ramsey, a fluent Welsh speaker, became the youngest-ever captain of the Wales national side in 2011 aged 20, and earned 82 international caps.
He was a part of the Wales side that reached the semifinals of Euro 2016 and participated in the World Cup in Qatar last year.