A linear-quadratic control problem with an infinite time horizon for some infinite dimensional controlled stochastic differential equations driven by a fractional Brownian motion is formulated and solved. The feedback form of the optimal control and the optimal cost are given explicitly. The optimal control is the sum of the well known linear feedback control for the associated infinite dimensional deterministic linear-quadratic control problem and a suitable prediction of the adjoint optimal system response to the future noise. Some examples of controlled stochastic partial differential equations that satisfy the problem formulation are given.