Green’s Dictionary of Slang

moonman n.

also moon’s man
[‘A moon-man signifies in English a madman...But these moon-men...are neither absolutely mad, nor yet perfectly in their wits. Their name they borrow from the moon, because, as the moon is never in one shape two nights together, but wanders up and down Heaven like an antic, so these changeable-stuff-companions never tarry one day in a place...’ Dekker (1608); this discussion of England’s gypsies is the first ever to be printed]

[17C–early 19C] a gypsy.