Manually merge improvements made in for_puppet

The relevant improvements should have been made here and then merged
into for_puppet, but I unfortunately lacked the discipline.
Small note on the value of locations_jboss