POSITION OPEN: Pliable leader sought for large, dysfunctional federal department. Must manage 240,000 unhappy employees in an environment of high-decibel chaos.

Ideal candidates will accept unachievable goals on impossible deadlines: Halt illegal immigration, deter asylum seekers from heading north, and stop all drug trafficking. Also, in your spare time, prevent terrorist attacks. The ability to project “toughness” a plus, including willingness to separate children from their parents.

Familiarity with federal law and congressional oversight optional. Experience irrelevant. Job tenure likely to be nasty, brutish and short. Apply to White House personnel office.

Would any sane person want this job?

The secretary of Homeland Security has a thankless task under the best of circumstances. He or she oversees a poorly knit empire of agencies from the Coast Guard (founded in 1790) to the Cyber and Infrastructure Security Agency (2018). The mission is to keep America safe from terrorists — at least that was the idea when Congress created the Homeland Security Department in 2002 in the aftermath of the Sept. 11 attacks.

But President Trump has focused on only one piece of the department’s vast mandate: enforcing immigration laws amid a sudden surge of asylum seekers. And he’s made it virtually impossible for any secretary to succeed.

The president wants his underlings to stop all unauthorized entries into the United States overnight, but there’s no practical way to make that happen.

His first solution was to build a “big beautiful wall” on the border, but he couldn’t persuade a Republican Congress to pay for one.

He’s proposed scrapping the law that guarantees asylum seekers a court hearing, but that would require new legislation — and he has consistently proved unable to get Congress to pass new laws.

Now his aides are proposing new regulations that would allow the government to hold children longer and deport asylum seekers faster — but all those new rules will face challenges in court.

Over the last two years, judges have regularly blocked similar schemes.

No future Homeland Security leader “will succeed at meeting his goals because the president doesn’t know what ‘fixing’ the border means,” Juliette Kayyem, a former assistant secretary of Homeland Security, told me.

The result has been chaos — and not just at the border.

Last weekend, Trump fired Kirstjen Nielsen, the hard-liner who had carried out his policy of separating children from their parents. But the leadership gap is much deeper and more alarming.

There’s no Senate-confirmed deputy secretary, the No. 2 job, and no undersecretary for management, the No. 3 job. There’s no commissioner for Customs and Border Protection, no director for Immigration and Customs Enforcement, no Secret Service director, no administrator for the Federal Emergency Management Agency.

Even before the latest purge, Homeland Security had a reputation as one of the most dysfunctional parts of the federal government.

On surveys of employee satisfaction, it ranks last on a list of 17 departments.

It’s hard to measure the effectiveness of a federal agency, especially when it comes to solving a problem as complex as terrorism.

But here’s a metric: As one of his first acts in office, Trump ordered Homeland Security to hire 15,000 more border agents and immigration officers. Two years later, staffing levels have remained static. Customs and Border Protection, which was supposed to expand by 5,000 people, paid a recruiting firm $19 million and reaped only 58 new hires.

Former Homeland Security officials worry that the president’s single-minded focus on immigration has sapped the department’s attention to other threats.

It’s a case of “myopia on the border,” Kayyem said. “The irony is that it is borderless threats that pose the greatest challenge … climate change, pandemics, cyberattacks and terrorism.”

One reason Nielsen was cashiered, it appears, is that she wasn’t spending all her time on immigration. That’s not a good lesson for her successor.

Assuming there is one. “All this chaos is going to deter anyone on the A-list from being interested,” another former official said. “The B-list too. Why would you put up with the hassle if you may get fired at any time?”

So who wants the job?

Stephen Miller, Trump’s grim-faced chief advisor on immigration, doesn’t appear to want it. He already has a better spot in the White House, which gives him power without responsibility.

Rick Perry, the secretary of Energy, has been mentioned, but he’s from Texas, so he knows too much about the border to endorse harebrained solutions.

In the last presidential campaign, Perry said a border wall was a dumb idea and warned that Trump had a “fundamental misunderstanding” of immigration.

The safest choice might be Kevin McAleenan, the current acting secretary. McAleenan is a hard-liner too — he administered last year’s family separation policy — but he has cordial relationships with Democrats in Congress.

Or if the president wants a firebrand, he could choose Kris Kobach, the former vice chairman of a Trump-appointed commission that tried and failed to find evidence of what the president insisted was widespread voter fraud in the 2016 election.

Kobach, who lost a bid to become governor of Kansas last year, has been virtually campaigning for the Homeland Security job on Fox News, offering Trump-style ideas such as setting up detention camps to house thousands of migrants in FEMA emergency trailers.

At least he’d be in sync with the president. But he’ll still be almost certain to fail. Don’t say nobody warned him.

Doyle McManus’ column appears on Wednesday and Sunday.