For quite some time I have been using Ansible to manage my macOS setup. Though fiddly, I have also put a Vagrant configuration around it so I can test the inclusion of packages prior to running on my actual machine.

https://github.com/svo/my-osx-setup

Since the setup has a great many things within it. I would suggest forking the GitHub repository and modifying it to your needs.

You can remove roles that you don’t want in your setup by removing the corresponding entry in the roles section of the playbook.yml file.

Ansible Roles

If you want to see what is in a role, as some are bundles of things like e.g. cli-tools, you can browse the roles directory and open the corresponding tasks/main.yml file.

My OSX Roles Directory
Ansible Roles Directory

Hope it proves helpful and don’t forget to Automate everything!