Ainley started out his rugby career in 2006 playing for the newly formed Makos in the ITM Cup and played all 10 of their games during their debut season, featuring exclusively as a flanker. He went on to captain the Makos is 2007 before handing it over to Andrew Goodman the following season. From 2007 to 2009, Ainley spent his off-seasons playing in Europe for Crociati in Parma. 2009 was to be his final campaign in his first spell with Tasman as he headed overseas to take up a contract with Japanese side, the Mitsubishi Dynaboars. He spent 3 seasons playing in the Japanese second division before heading home to New Zealand again in 2013. He was immediately named in the Makos squad for the 2013 ITM Cup and featured in 10 matches as they won promotion to the Premiership. Another impressive season followed in 2014 as the men from Nelson went all the way to the Premiership final before losing out 36-32 to. Tasman continued their good form through 2015 and 2016, finishing as losing semi-finalists and runner-up respectively. Ainley played 19 times across the 2 seasons and contributed 4 tries including one in the 44-24 defeat to in the 2015 semi-final.
He was rewarded for years of hard work and toil when at the age of 33 he was handed his first Super Rugby contract by the Dunedin-based ahead of the 2015 Super Rugby season. He endured a tough start to his spell with the Highlanders, finding himself 4th choice lock for the franchise behind the more established Joe Wheeler, Mark Reddish and Tom Franklin and also broke his jaw playing club rugby early into the season. However, the second half of his first year in Dunedin was far brighter as injuries to the 'Landers senior locks saw Ainley, who himself had just returned to fitness, named in their touring party for the trip to where he made his Super Rugby debut in a 45-24 victory over the in Bloemfontein. He went on to start 8 games during a historic year which culminated with the Highlanders lifting the Super Rugby trophy for the first time in their history, defeating the 21-14 in the final. He featured 11 times in 2016, however the Highlanders were unable to hold on to their Super Rugby crown, going down 42-30 to the in Johannesburg. Tony Brown replaced the -bound Jamie Joseph ahead of the 2017 season and he retained the 35 year-old Ainley in the squad for his first campaign in charge.