fixup test
add tests for new install_puppet functionality
Refactor `puppet_install`

This changes the `puppet_install` function to be more readable and reduce
code duplication. It does not change any behavior.