Exact solution of a two-dimensional random Ising model