First, using Ansible for setting up a single Mac is
way overkill. Jeff's only doing it because he literally wrote the book on Ansible. For a single Mac where you want reproducible, just use shell script(s).
Anyway, for my Ansible environment for servers and network devices, I use uv[1]. It works flawlessly.
If I were doing things even more right, I'd host it in a container, but I don't have time for all that right now.
And nobody's mentioned Homebrew[2], yet.
PS: OS X is now called macOS, and at least in some parts, "OS X" is still used to refer to really old OS releases and may generate some confusion.
1. https://docs.astral.sh/uv/
2. https://brew.sh/