If the court imposes the community service sentence, a written agreement shall be immediately executed by the defendant and the Department of Corrections representative. The agreement shall contain such provisions and conditions as the Department of Corrections and the court shall deem just and appropriate.