adding some code to support masterless puppet runs, ht @blalor