Chef and Ansible both make Linux configuration repeatable. They fail in different ways, and the replacement cost is high once cookbooks or roles are in production. Choose from the estate you have, not from a feature grid.
How each one runs
Chef Infra uses an agent. chef-client runs on the node, reads policy, and converges the host. Cookbooks are written in a Ruby DSL. That is comfortable for people who already treat infrastructure as code, and it is a barrier for a team that only wanted a YAML file.
Ansible is agentless. A control node opens SSH and applies plays. Playbooks are YAML. A second run on an unchanged host should change nothing, but that only happens if the roles were written to be idempotent. Ansible will happily run a shell task that is not.
Where the difference shows up
- Continuous enforcement. Chef is built to keep applying policy. Ansible usually runs when someone or a scheduler starts it. Both models are valid. They are not the same operational promise.
- Fleet access. Ansible needs SSH from a control node to every host. Chef needs the client installed and a way for that client to reach its policy. Locked-down networks sometimes allow one and not the other.
- Skill mix. A team that will not maintain Ruby will not maintain Chef. A team that pastes shell into Ansible tasks will create a second, worse wiki.
- Enterprise controllers. Chef Infra Server and Red Hat Ansible Automation Platform add RBAC and a job history. They are products with their own upkeep. Do not adopt one only because a diagram showed it.
A decision that usually holds
Stay with the tool that already manages production, unless it is abandoned or nobody can change it safely. If you are starting, Ansible is often the shorter path to a reviewed patch play. Chef is the better default when you want the node to keep correcting itself between changes. Many estates use Terraform for the cloud resources and only one of these tools for the operating system.
If you are stuck with a half-finished implementation of either, ask for a configuration-management review rather than a migration you have not justified.