The 82-year-old was offered the part of a local dignitary after producers discovered that he was a huge fan of the show, reports The Sun.
An insider said: "Roger is a massive fan so we thought it would be fun to get him involved. Producers approached his people and they said he'd love to, so we came up with a role for him.
"They've gone for something which they think he'll be comfortable with - a local dignitary. He's known for playing smooth and authoritative characters so it is right up his street."
They added: "You could hardly have him sitting around the pool in a wife-beater vest drinking lager all day."
Moore is apparently due to fly out to the Spanish holiday resort in the next few days to film his scenes for the show's upcoming fourth series.
Katie Price, Cilla Black, Louie Spence and 4 Poofs and a Piano are also believed to be appearing in future episodes of the sitcom.