[FEATURE] Import chef logic from gatewayd proper.