Is there not a built-in chef resource that can do this and hide this complexity?