same idea as 862e329, but works with puppet >= 3