This question already has an answer here:
I read a book a few years back. It was about a guy working on the moon who while out on survey fell into a Crack in the moon and found himself talking to an unknown intelligence. It turns out he was part of an ancient race and the moon was actually a large spaceship covered with dust and rocks because of its size. He ends up becoming the ship's captain and he has to fight an ancient foe. This spans across several books I just can't remember the title of any of them.