Added check on the exit code of puppet apply