OP asked for something consistent and between K8s and Swarm. Ansible is just a mistake that people refuse to stop using.
OP asked for something consistent and between K8s and Swarm. Ansible is just a mistake that people refuse to stop using.
So is Helm! Helm is just a mistake that people refuse to stop using.
Comparing that to docker swarm and/or k8s manifests (I guess even Helm if you're not the one developing charts), Ansible is a complete mess. You're better off managing things with Puppet or Salt, as that gives you an actual declarative mechanism (i.e. desired state like K8s manifests).
We thought this, too, when choosing Salt over Ansible, but that was a complete disaster.
Ansible is definitely designed to operate at a lower abstraction level, but modules that behave like desired state declarations actually work very well. And creating your own modules turned out to be at least an order of magnitude easier than in Salt.
We do use Ansible to manage containers via podman-systemd, but slightly hampered by Ubuntu not shipping with podman 5. It's... fine?
Our mixed Windows, Linux VM and Linux bare metal deployment scenario is likely fairly niche, but Ansible is really the only tenable solution.
In my experience, it only works decently well when a special care is taken of when writing playbooks.