Updated to run correctly from within puppet