Boxen (https://github.com/boxen/puppet-boxen) used Puppet to achieve this. It worked, but it was quite opinionated and of course you needed to know Puppet so the learning curve was steep. It's since been superseded by Homebrew which I find is a far better experience.