Hartley, 29, won the FA Youth Cup with Manchester City as a youngster, and signed a contract with Colls last summer having made 26 appearances the previous campaign.
He takes on a goalkeeping coach role at Oldham, after previously coaching their youth teams and being involved in the Latics’ pre-season camp in Morocco.
Colls boss Michael Clegg said: “We are obviously very disappointed to lose Greg. He has been instrumental in our success over the last two years.
“I honestly believe it’s so sad for Greg to end his playing days so early as for me he is the best keeper around. He wants to pursue a career in coaching and to be around the Oldham first team is a chance he can’t turn down. Personally and collectively he will be missed. His family are great people too, I’m sure it won’t be the last time we see Greg in a Colls shirt.
“We have a great keeper in Chris Cheetham and we are also actively looking for another. That process started last week so expect some sort of news over the next couple of week.”
Keep up-to-date with our exclusive email newsletters.
Subscribe