Interview Prep/Ansible/Testing, CI/CD and Quality

Docker, Podman or real VMs as the Molecule driver: how do you choose?

AdvancedProductionTesting, CI/CD and Quality
Answer
  • Docker / Podman (via molecule-plugins[docker] or [podman]): seconds to start, cheap, perfect for package, file, template and user logic. Weak for kernel modules, sysctl, firewalld, SELinux, mounts and anything that needs a real init system.
  • VMs (EC2, Vagrant, or the default delegated driver with your own create/destroy playbooks): slow and costs money, but tests the real thing.

In production we use containers for every PR and a VM scenario (molecule test -s ec2) for roles that touch the kernel, networking or boot, run on merge or nightly. Podman is the natural choice on RHEL-based CI runners where rootless containers are the norm. Whatever the driver, the instance image must match production's OS major version.

All Ansible questions Roadmap: Ansible

More on Testing, CI/CD and Quality