Australia is now mired in an open-ended $300 million a year debacle in Iraq, with no coherent exit strategy except, apparently, to maximise the risk to Australians that the government’s campaign against Islamic State is creating.

It’s only a few months since the optimistic talk was of IS — or “Daesh death cult” as Tony Abbott likes to melodically call it — being on the run. The defeat of the IS campaign to capture Kobane, in Syria, was heralded as the beginning of the end. There were ambitious American plans for an Iraqi Army spring offensive to recapture Mosul. Iraqi forces and Shiite militias backed by Iran and aided by United States air strikes retook Tikrit in March and April. But by then the idea of retaking Mosul had been abandoned. Then Ramadi fell last week, its defenders — supposedly the elite units of the Iraqi Army — routed by IS militias and suicide bombers, and as appears to be the rule in this conflict, they left in their wake a rich trove of new American weaponry and vehicles for IS forces to collect.

This is how we get our weapons,” says IS. Thank you, American taxpayers.

Now Shiite militias — who once waged war on the allied occupation forces — are likely to be sent in to try to force IS out of Ramadi. Based on the Tikrit experience, victory there will be a precursor to reprisal atrocities against Sunnis, regardless of whether they support or oppose IS.

In the wake of Ramadi, former Iraq commander and one-time Coalition staffer Jim Molan told Fairfax the conflict was now a “stalemate”. It was Molan who had cheerfully declared in December — in response to statements then that the conflict had become a stalemate — that the allied effort against IS in fact had been “remarkably successful”. When even the Coalition’s military cheerleaders start using words like “stalemate”, it’s a bad sign. And we’ve committed hundreds of millions of dollars to that stalemate.

Other military types have themselves downgraded their appraisals. Former general Peter “get ready for a 100-year war against Islam” Leahy now says about IS: “They are showing initiative, they’re showing they have strategic reach, that they have an eye for the dramatic and for some bravado.”

The Australian government is deluding itself that it is effectively training what the Iraqi Army to fight this conflict, spending hundreds of millions of dollars in doing so. This is wash, rinse, repeat: in 2007 John Howard boasted “training and mentoring Iraqi forces has been a key element of Australian support for Iraq ever since 2003. The Australian Army has been involved in the basic training of more than 12,500 Iraqi soldiers.” Right-wing Tasmanian MP Andrew Nikolic likes to boast of his role in that training mission, which, judging by the results since, was a miserable failure. Shiite militias, backed by Iran — whom Nikolic wants the West to attack — are so far the only forces that have demonstrated a capacity to retake key locations from IS.

Now we’re spending $300 million a year re-doing the training we were told we’d done eight years ago.

Islamic State is a vivid demonstration of what even the head of the CIA John Brennan has acknowledged: the War on Terror has been very good at, to use Brennan’s term, “stimulating” people to join the ranks of terrorists. Indeed, IS is entirely a creation of the Iraq War, and the current Western campaign against it has been a profound stimulus to recruitment for it. And for every dollar Australia spends as part of its role in Iraq, we are in effect helping fund IS recruitment, not merely in Syria and Iraq but here in Australia as well.

Of particular concern, of course, have been young Australians lured to join IS, a trend that prompted the passage of more draconian anti-terror laws last year, although it’s not clear if the new laws have had even the slightest effect on stopping young Australian men from travelling abroad with the goal of joining the barbarous ranks of IS.

But if it is unable to prevent them travelling abroad, the government is certainly committed to discouraging them from returning home. The Prime Minister has been at pains this week to ensure any Australian who regrets travelling to Syria to join IS can expect to be jailed if they come home. The government’s hard line of jailing returning jihadis for 25 years was endorsed by the Telegraph today under the splendid headline “We’ve jihad it with you”.

The logic of the government’s stance is presumably that disillusioned Australian jihadis should be encouraged to stay in Syria and Iraq and keep fighting for IS rather than face 25 years’ imprisonment back home. This might make a kind of sickening sense if the Iraqis, the Syrian regime, the Iranians and the allied air campaign were successful in halting and killing IS forces, but Ramadi suggests that isn’t the case. And it’s at odds with the view of intelligence officials like former senior MI6 chief Richard Barrett, who explained last year that disillusioned returning jihadis were likely to be most successful at “undermining the terrorism narrative”. As long as they were “committed to a non-violent future”, Barrett said,

“These are the people who can expose the true nature of the Islamic State and its leadership. Their stories of brutality and the motives behind it will be far more credible and persuasive than the rhetoric of men in suits.”

In other countries, the focus is on deradicalisation of returning fighters, not punishment, to ensure they can successfully reintegrate into Western societies and serve as examples to discourage potential recruits. The Abbott government’s focus, it appears, is on deterring them from returning at all with threats of spending a quarter of a century in prison.

The result may well be that not merely are we stimulating terrorism recruitment, but encourages terrorism retention as well. That would indeed make for a novel Australian variant of the self-perpetuating War on Terror.