By Andrew Cawthorne

CARACAS (Reuters) - Venezuela's wily President Hugo Chavez is keeping his military happy and quashing talk of succession with a reshuffle of allies to strengthen his hand as he seeks re-election in October.

Since leading a failed coup attempt in 1992 and coming from behind to win the presidency in 1998, then polarizing the nation during 13 years of socialist rule, the former soldier has always applied a favored army tactic to his politics: surprise.

So nobody foresaw his latest moves - giving the top job in Congress to a buddy from the armed forces, and ordering two senior cabinet figures who were touted as possible successors to run for governorships in opposition-ruled provincial states.

Chavez has also baited Washington by appointing a man it says is a drug "kingpin" as his new defense minister. And he has his allies currying favor and guessing at his next move by leaving unnamed two major posts: vice president and foreign minister.

"It's the way of authoritarian rulers down the ages," said Caracas student Claudio Fernandez, who is undecided how to vote in October. "They always move people around so that nobody becomes too comfortable and the king is unchallenged."

Chavez's most eye-catching move in the New Year changes was the return of Diosdado Cabello - a fellow ex-soldier who joined Chavez's coup attempt against former President Carlos Andres Perez in 1992 - to the limelight as National Assembly president.

That, along with his post as No. 2 in the ruling Socialist Party, brings back to the fore a man whom Chavez had relegated in the past amid whispers he was becoming too powerful.

It also sends a clear message to the military: that their faction remains central in the president's inner circle.

"The comandante knows who he can trust," one Chavez government official told Reuters on condition of anonymity.

Chavez may well need the military behind him if he wins narrowly or there are fraud allegations over the October 7 election. He has vowed to step down without any fuss if he loses the vote, but insists an opposition victory is impossible.

"It is easier for a thousand buffalos to pass through the eye of a needle than for an opposition candidate to win the election," Chavez said this week, adapting a well-known Biblical passage for his campaign rhetoric.

HEALTH DOUBTS LINGER

Most pollsters and analysts believe Chavez has an edge right now ahead of the election - albeit a narrow one - given his vast financial resources, big party machinery and undoubted status as the country's most popular politician.

But the panorama could change if the opposition coalition, which will choose its candidate at a primary next month, runs a dynamic and nationally appealing campaign, or if Chavez's apparent recovery from cancer fades.

During his surgery in Cuba and then rounds of chemotherapy and other treatment during the second half of last year, Vice President Elias Jaua and Foreign Minister Nicolas Maduro - both from the socialists' so-called "civilian wing" as opposed to the army faction - gained influence.

Giving orders and seemingly in charge of day-to-day affairs, the pair - Maduro in particular - looked to diplomats and other Venezuela-watchers increasingly like possible successors.

But Chavez has told both they will soon be stepping down to fight for governorships against opposition incumbents in state elections a couple of months after the presidential vote.

That serves the purpose of putting heavy hitters in the field to drum up votes, reducing the buzz around them at the center of power, and further reassuring the military that its representatives still hold the most sway.

Chavez underlined that message on Tuesday, and also openly provoked his old enemy the United States, when he swore in General Henry Rangel Silva as his new defense minister.

In 2008, the U.S. government accused Rangel of being a "drug kingpin" who collaborated with Colombia's FARC rebels, while Venezuela's opposition say past remarks by Rangel showed he believes the army should not accept a Chavez defeat this year.

Chuckling at the furor, Chavez chided his enemies for protesting at the promotion of such a "good soldier."

Critics, though, believe that the flurry of recent moves within his top team could mean the president is quashing a major power struggle that has long been speculated, but never publicly confirmed, since his cancer diagnosis last June.

"The scorpions are out," said Teodoro Petkoff, a newspaper editor and former government minister who is now one of Chavez's most withering critics. "There is a silent but sordid frenzy over the succession issue opened up by the president's illness."

In a further tactic to silence any speculation of his exit from the political stage, Chavez has been dominating the airwaves again in recent weeks -- no doubt to the consternation of doctors still advising him to limit his public appearances.

On Friday, he smashed his own record - and possibly set a world first - by giving a speech for more than nine-and-a-half hours. His medical team had told him to stop after three.

"I could have gone on longer, but my feet were hurting," Chavez said the following day. "I'm not made of iron or steel!"

(Additional reporting by Mario Naranjo; Editing by Daniel Wallis and Kieran Murray)