At least by today's central vac units, they've improved than what central vacs were a while ago. They are perhaps the best all surface cleaners on the market. If you're concerned about the ants being trapped in the pipes, then suck up some cleaning wipes like the Tornado Maintenance Cloths. And if you're concerned about ants living in a central vac, then get a water filtration power unit like Aqua-Air for example. Their 258 model is guaranteed to kill ants because it has one of the highest air pressures of central vacs, you can also suck up water to flush through the pipes, and the water tank would automatically drain down into the sewer. Or at least get a bagless unit where you can empty out the unit at any time you'd want. Can't do that with a bagged unit cause you'd have to use it until the bag gets full.
[URL unfurl="true"]https://www.aquaair-wetdry.com/product-page/aa004-w-8-4-model-258-heavy-duty-central-vacuum-unit-wet-extractor-with-2[/URL]